starting slowy trying to make docker compose work
This commit is contained in:
parent
acedd76b8e
commit
0b92a98ed7
1
.gitignore
vendored
1
.gitignore
vendored
@ -0,0 +1 @@
|
|||||||
|
#.env
|
||||||
34
Makefile
Normal file
34
Makefile
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
# **************************************************************************** #
|
||||||
|
# #
|
||||||
|
# ::: :::::::: #
|
||||||
|
# Makefile :+: :+: :+: #
|
||||||
|
# +:+ +:+ +:+ #
|
||||||
|
# By: apommier <apommier@student.42.fr> +#+ +:+ +#+ #
|
||||||
|
# +#+#+#+#+#+ +#+ #
|
||||||
|
# Created: 2023/03/19 09:29:27 by apommier #+# #+# #
|
||||||
|
# Updated: 2023/03/19 11:22:00 by apommier ### ########.fr #
|
||||||
|
# #
|
||||||
|
# **************************************************************************** #
|
||||||
|
|
||||||
|
all:
|
||||||
|
# -mkdir -p /home/apommier/data/wordpress
|
||||||
|
# -mkdir -p /home/apommier/data/mariadb
|
||||||
|
docker-compose -f docker-compose.yml up --build
|
||||||
|
|
||||||
|
fclean: down
|
||||||
|
# -sudo rm -rf /home/apommier/data/wordpress
|
||||||
|
# -sudo rm -rf /home/apommier/data/mariadb
|
||||||
|
-docker rm $$(docker ps -qa)
|
||||||
|
-docker rmi -f $$(docker images -qa)
|
||||||
|
-docker volume rm $$(docker volume ls -q)
|
||||||
|
-docker network rm $$(docker network ls -q)
|
||||||
|
up:
|
||||||
|
docker-compose -f ./docker-compose.yml up
|
||||||
|
|
||||||
|
back:
|
||||||
|
docker-compose -f ./docker-compose.yml up --build -d
|
||||||
|
|
||||||
|
down:
|
||||||
|
docker-compose -f ./docker-compose.yml down
|
||||||
|
|
||||||
|
re: fclean all
|
||||||
0
backend/bon_courage.js
Normal file
0
backend/bon_courage.js
Normal file
16
conf/nginx.conf
Normal file
16
conf/nginx.conf
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
server {
|
||||||
|
listen 443 ssl;
|
||||||
|
listen 80 ssl;
|
||||||
|
|
||||||
|
server_name homemadePong.42.fr;
|
||||||
|
|
||||||
|
ssl_protocols TLSv1.3;
|
||||||
|
ssl_certificate /etc/ssl/certs/nginx-selfsigned.crt;
|
||||||
|
ssl_certificate_key /etc/ssl/private/nginx-selfsigned.key;
|
||||||
|
|
||||||
|
index index.php;
|
||||||
|
|
||||||
|
root /var/www/html;
|
||||||
|
|
||||||
|
autoindex on;
|
||||||
|
}
|
||||||
@ -0,0 +1,67 @@
|
|||||||
|
version: "3.3"
|
||||||
|
|
||||||
|
services:
|
||||||
|
|
||||||
|
nginx:
|
||||||
|
build:
|
||||||
|
context : ./
|
||||||
|
dockerfile: ./dockerfiles/Dockerfile.nginx
|
||||||
|
container_name: nginx
|
||||||
|
#image: nginx:homemade
|
||||||
|
depends_on:
|
||||||
|
- backend
|
||||||
|
ports:
|
||||||
|
- 443:443
|
||||||
|
volumes:
|
||||||
|
- ./frontend:/var/www/html
|
||||||
|
restart: unless-stopped
|
||||||
|
networks:
|
||||||
|
- pongNetwork
|
||||||
|
|
||||||
|
backend:
|
||||||
|
build:
|
||||||
|
context : ./
|
||||||
|
dockerfile: ./dockerfiles/Dockerfile.backEnd
|
||||||
|
container_name: webapp
|
||||||
|
#image: wordpress:homemade
|
||||||
|
env_file: .env
|
||||||
|
#volumes:
|
||||||
|
# - wp_files:/var/www/html
|
||||||
|
depends_on:
|
||||||
|
- postgresql
|
||||||
|
networks:
|
||||||
|
- pongNetwork
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
postgresql:
|
||||||
|
build: #./dockerfiles/Dockerfile.PostgreSQL
|
||||||
|
context : ./
|
||||||
|
dockerfile: ./dockerfiles/Dockerfile.PostgreSQL
|
||||||
|
container_name: postgresql
|
||||||
|
#image: mariadb:homemade
|
||||||
|
ports:
|
||||||
|
- 3306:3306
|
||||||
|
env_file: .env
|
||||||
|
#volumes:
|
||||||
|
# - dbdata:/var/lib/mysql
|
||||||
|
networks:
|
||||||
|
- pongNetwork
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
|
networks:
|
||||||
|
pongNetwork:
|
||||||
|
driver: bridge
|
||||||
|
|
||||||
|
volumes:
|
||||||
|
front_files:
|
||||||
|
driver: local
|
||||||
|
driver_opts:
|
||||||
|
type: none
|
||||||
|
o: 'bind'
|
||||||
|
device: '/frontend'
|
||||||
|
dbdata:
|
||||||
|
driver: local
|
||||||
|
driver_opts:
|
||||||
|
type: none
|
||||||
|
o: 'bind'
|
||||||
|
device: '/home/apommier/data/mariadb'
|
||||||
13
dockerfiles/Dockerfile.PostgreSQL
Normal file
13
dockerfiles/Dockerfile.PostgreSQL
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# **************************************************************************** #
|
||||||
|
# #
|
||||||
|
# ::: :::::::: #
|
||||||
|
# Dockerfile.PostgreSQL :+: :+: :+: #
|
||||||
|
# +:+ +:+ +:+ #
|
||||||
|
# By: apommier <apommier@student.42.fr> +#+ +:+ +#+ #
|
||||||
|
# +#+#+#+#+#+ +#+ #
|
||||||
|
# Created: 2023/03/19 09:28:30 by apommier #+# #+# #
|
||||||
|
# Updated: 2023/03/19 11:24:21 by apommier ### ########.fr #
|
||||||
|
# #
|
||||||
|
# **************************************************************************** #
|
||||||
|
|
||||||
|
FROM postgres:latest
|
||||||
13
dockerfiles/Dockerfile.backEnd
Normal file
13
dockerfiles/Dockerfile.backEnd
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# **************************************************************************** #
|
||||||
|
# #
|
||||||
|
# ::: :::::::: #
|
||||||
|
# Dockerfile.webPage :+: :+: :+: #
|
||||||
|
# +:+ +:+ +:+ #
|
||||||
|
# By: apommier <apommier@student.42.fr> +#+ +:+ +#+ #
|
||||||
|
# +#+#+#+#+#+ +#+ #
|
||||||
|
# Created: 2023/03/19 09:28:33 by apommier #+# #+# #
|
||||||
|
# Updated: 2023/03/19 11:36:48 by apommier ### ########.fr #
|
||||||
|
# #
|
||||||
|
# **************************************************************************** #
|
||||||
|
|
||||||
|
FROM node:latest
|
||||||
22
dockerfiles/Dockerfile.nginx
Normal file
22
dockerfiles/Dockerfile.nginx
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
# **************************************************************************** #
|
||||||
|
# #
|
||||||
|
# ::: :::::::: #
|
||||||
|
# Dockerfile.nginx :+: :+: :+: #
|
||||||
|
# +:+ +:+ +:+ #
|
||||||
|
# By: apommier <apommier@student.42.fr> +#+ +:+ +#+ #
|
||||||
|
# +#+#+#+#+#+ +#+ #
|
||||||
|
# Created: 2023/03/19 09:28:32 by apommier #+# #+# #
|
||||||
|
# Updated: 2023/03/19 09:28:33 by apommier ### ########.fr #
|
||||||
|
# #
|
||||||
|
# **************************************************************************** #
|
||||||
|
|
||||||
|
FROM nginx:latest
|
||||||
|
|
||||||
|
RUN apt update -y
|
||||||
|
RUN apt-get install -y openssl
|
||||||
|
|
||||||
|
RUN mkdir -p /etc/ssl/private
|
||||||
|
RUN mkdir -p /etc/ssl/certs
|
||||||
|
RUN openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout /etc/ssl/private/nginx-selfsigned.key -out /etc/ssl/certs/nginx-selfsigned.crt -subj "/C=FR/ST=17/L=StJeanDeLiversay/O=42/CN=apommier"
|
||||||
|
|
||||||
|
COPY conf/nginx.conf /etc/nginx/conf.d/default.conf
|
||||||
10
frontend/index.html
Normal file
10
frontend/index.html
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html>
|
||||||
|
<head>
|
||||||
|
<title>Ma première page web</title>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<h1>Bienvenue sur ma page web !</h1>
|
||||||
|
<p>Je suis content de vous accueillir sur ma première page web.</p>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Loading…
Reference in New Issue
Block a user