feat: update Dockerfiles to use Node 25-alpine and enhance nginx configuration for API proxying

This commit is contained in:
Thibault Pouch
2026-03-12 10:59:01 +01:00
parent 4768bd5184
commit 77d57fb354
4 changed files with 16 additions and 10 deletions

View File

@@ -19,15 +19,10 @@ services:
restart: unless-stopped restart: unless-stopped
ports: ports:
- "3000:3000" - "3000:3000"
env_file:
- ./nest-backend/.env
environment: environment:
DATABASE_URL: postgresql://nest_user:nest_password@db:5432/nest_db DATABASE_URL: postgresql://nest_user:nest_password@db:5432/nest_db
JWT_SECRET: ${JWT_SECRET:-change_me_in_production}
PORT: 3000
ADMIN_USERNAME: ${ADMIN_USERNAME:-admin}
ADMIN_EMAIL: ${ADMIN_EMAIL:-admin@crowmate.fr}
ADMIN_PASSWORD: ${ADMIN_PASSWORD:-change_me}
FRONT_ORIGIN: ${FRONT_ORIGIN:-http://localhost:5173}
INTRA_ORIGIN: ${INTRA_ORIGIN:-http://localhost:5174}
depends_on: depends_on:
db: db:
condition: service_healthy condition: service_healthy
@@ -39,12 +34,18 @@ services:
restart: unless-stopped restart: unless-stopped
ports: ports:
- "5173:5173" - "5173:5173"
environment:
API_URL: http://api:3000
depends_on:
- api
intra: intra:
build: ./nest-intra build: ./nest-intra
restart: unless-stopped restart: unless-stopped
ports: ports:
- "5174:5174" - "5174:5174"
depends_on:
- api
volumes: volumes:
db_data: db_data:

View File

@@ -1,4 +1,4 @@
FROM node:22-alpine AS build FROM node:25-alpine AS build
WORKDIR /app WORKDIR /app

View File

@@ -1,4 +1,4 @@
FROM node:22-alpine AS build FROM node:25-alpine AS build
WORKDIR /app WORKDIR /app

View File

@@ -3,10 +3,15 @@ server {
root /usr/share/nginx/html; root /usr/share/nginx/html;
index index.html; index index.html;
# Docker DNS; resolve API service name at request time.
resolver 127.0.0.11 ipv6=off valid=10s;
set $api_upstream http://api:3000;
location /api/ { location /api/ {
proxy_pass http://api:3000/api/; proxy_pass $api_upstream/api/;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
} }
location / { location / {