Merge remote-tracking branch 'origin/main'

This commit is contained in:
toine 2025-10-04 17:48:33 +02:00
commit 618b740588
4 changed files with 64 additions and 0 deletions

7
backend/Dockerfile Normal file
View file

@ -0,0 +1,7 @@
from python:3.11-slim
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
COPY . .
EXPOSE 8887
CMD ["python", "app.py"]

38
docker-compose.yml Normal file
View file

@ -0,0 +1,38 @@
services:
backend:
container_name: monsite-perso-backend
build: ./backend
ports:
- "8887:8887"
environment:
- FLASK_ENV=production
networks:
- site_perso_network
frontend:
container_name: monsite-perso-frontend
build: ./frontend
ports:
- "3001:3001"
depends_on:
- backend
networks:
- site_perso_network
nginx_site_perso:
image: nginx:latest
container_name: nginx_site_perso
expose:
- "80"
volumes:
- ./nginx/conf.d:/etc/nginx/conf.d
networks:
- site_perso_network
- global_network
restart: always
networks:
site_perso_network:
driver: bridge
global_network:
external: true

8
frontend/Dockerfile Normal file
View file

@ -0,0 +1,8 @@
from node:18-alpine
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm install
COPY . .
#RUN npm run build
EXPOSE 3001
CMD ["npm", "run", "start", "--", "-p", "3001"]

11
nginx/conf.d/backend.conf Normal file
View file

@ -0,0 +1,11 @@
server {
listen 80;
server_name api.violet-anthony.eu;
location / {
proxy_pass http://monsite-perso-backend:8887;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}