feat: Docker Compose avec Node.js pré-compilé pour déploiement sans npm

This commit is contained in:
2026-02-05 01:50:40 +01:00
parent 1228a02221
commit ba48c760c5
2 changed files with 18 additions and 14 deletions

View File

@@ -2,17 +2,11 @@ FROM node:18-alpine
WORKDIR /app
# Copy npm config
COPY .npmrc ./
# Copy package files
COPY backend/package*.json ./
# Install dependencies - handle npm bug with explicit install
RUN npm cache clean --force && \
npm install --no-optional --legacy-peer-deps || true && \
npm install express express-session bcryptjs dotenv cors multer fs-extra && \
test -d node_modules/express || (ls -la node_modules/ && echo "FATAL: express not found" && exit 1)
# Copy pre-built node_modules (already present)
COPY backend/node_modules ./node_modules/
# Copy application code
COPY backend/src ./src

View File

@@ -1,20 +1,30 @@
version: '3.8'
services:
app:
build:
context: .
dockerfile: Dockerfile
container_name: webnationsglory-admin
environment:
NODE_ENV: production
PORT: 4001
SERVER_DIR: /mc-server
SERVER_DIR: /home/innotex/NationsGloryRED/NationsGlory_ServeurBuild_Red
RCON_HOST: localhost
RCON_PORT: 25575
SESSION_SECRET: change-this-in-production
SESSION_SECRET: your-secret-key-change-in-production
volumes:
- /NationsGloryRED/NationsGlory_ServeurBuild_Red:/mc-server
- web-admin:/mc-server/.web-admin
- /home/innotex/NationsGloryRED/NationsGlory_ServeurBuild_Red:/mc-server
- web-admin-data:/app/data
ports:
- "4001:4001"
restart: unless-stopped
network_mode: host
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:4001/api/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
volumes:
web-admin:
web-admin-data: