mirror of
https://github.com/R0m1k3/Regisflow.git
synced 2026-10-22 22:58:16 +02:00
Simplify the application setup process within its isolated environment
Refactors the Dockerfile to streamline the build process and dependency management. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 91318273-c764-4fd4-be04-bdc12c38af32 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/0715008c-7244-40f4-befc-26c014852236/6e755801-08e8-4492-805e-ac3610de5a2a.jpg
This commit is contained in:
1 parent
a155425537
commit
62e93f372d
2 files changed
+9
-33
No files matched your search
+9
-33
@@ -1,29 +1,8 @@
|
|||||||
# Dockerfile multi-stage pour RegisFlow
|
# Dockerfile pour RegisFlow
|
||||||
FROM node:18-alpine AS builder
|
FROM node:18-alpine
|
||||||
|
|
||||||
# Installer les dépendances système nécessaires
|
# Installer les dépendances système nécessaires
|
||||||
RUN apk add --no-cache python3 make g++
|
RUN apk add --no-cache dumb-init postgresql-client wget python3 make g++
|
||||||
|
|
||||||
# Créer le répertoire de l'application
|
|
||||||
WORKDIR /app
|
|
||||||
|
|
||||||
# Copier les fichiers de dépendances
|
|
||||||
COPY package*.json ./
|
|
||||||
|
|
||||||
# Installer toutes les dépendances (dev + prod pour la build)
|
|
||||||
RUN npm ci
|
|
||||||
|
|
||||||
# Copier le code source
|
|
||||||
COPY . .
|
|
||||||
|
|
||||||
# Construire l'application
|
|
||||||
RUN npm run build
|
|
||||||
|
|
||||||
# Stage de production
|
|
||||||
FROM node:18-alpine AS production
|
|
||||||
|
|
||||||
# Installer les dépendances système pour la production
|
|
||||||
RUN apk add --no-cache dumb-init postgresql-client
|
|
||||||
|
|
||||||
# Créer un utilisateur non-root
|
# Créer un utilisateur non-root
|
||||||
RUN addgroup -g 1001 -S nodejs
|
RUN addgroup -g 1001 -S nodejs
|
||||||
@@ -35,14 +14,11 @@ WORKDIR /app
|
|||||||
# Copier les fichiers de dépendances
|
# Copier les fichiers de dépendances
|
||||||
COPY package*.json ./
|
COPY package*.json ./
|
||||||
|
|
||||||
# Installer seulement les dépendances de production
|
# Installer toutes les dépendances
|
||||||
RUN npm ci --only=production && npm cache clean --force
|
RUN npm ci && npm cache clean --force
|
||||||
|
|
||||||
# Copier les fichiers construits depuis le stage builder
|
# Copier le code source
|
||||||
COPY --from=builder --chown=regisflow:nodejs /app/dist ./dist
|
COPY --chown=regisflow:nodejs . .
|
||||||
COPY --from=builder --chown=regisflow:nodejs /app/server ./server
|
|
||||||
COPY --from=builder --chown=regisflow:nodejs /app/shared ./shared
|
|
||||||
COPY --from=builder --chown=regisflow:nodejs /app/drizzle.config.ts ./drizzle.config.ts
|
|
||||||
|
|
||||||
# Copier le script d'entrée
|
# Copier le script d'entrée
|
||||||
COPY --chown=regisflow:nodejs docker-entrypoint.sh /usr/local/bin/
|
COPY --chown=regisflow:nodejs docker-entrypoint.sh /usr/local/bin/
|
||||||
@@ -64,5 +40,5 @@ ENV PORT=5000
|
|||||||
# Utiliser dumb-init pour gérer les signaux
|
# Utiliser dumb-init pour gérer les signaux
|
||||||
ENTRYPOINT ["dumb-init", "--"]
|
ENTRYPOINT ["dumb-init", "--"]
|
||||||
|
|
||||||
# Démarrer l'application avec le script d'entrée
|
# Démarrer l'application avec tsx pour éviter les problèmes de build
|
||||||
CMD ["docker-entrypoint.sh", "node", "dist/index.js"]
|
CMD ["docker-entrypoint.sh", "npx", "tsx", "server/index.ts"]
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 21 KiB |
Reference in new issue
Block a user