mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-11 17:26:45 +02:00
Includes a Dockerfile for building the application image and an INSTALLATION.md file detailing the setup process, prerequisites, and helpful commands for managing the application on a private server. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda Replit-Commit-Checkpoint-Type: intermediate_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/ds3R7vP
45 lines
896 B
Docker
45 lines
896 B
Docker
# Étape 1: Build de l'application
|
|
FROM node:20-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Copier les fichiers de dépendances
|
|
COPY package*.json ./
|
|
|
|
# Installer toutes les dépendances (dev + prod)
|
|
RUN npm ci
|
|
|
|
# Copier le reste du code source
|
|
COPY . .
|
|
|
|
# Build du frontend
|
|
RUN npm run build
|
|
|
|
# Étape 2: Image de production
|
|
FROM node:20-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Installer uniquement les dépendances de production
|
|
COPY package*.json ./
|
|
RUN npm ci --only=production
|
|
|
|
# Copier les fichiers buildés et le code serveur
|
|
COPY --from=builder /app/dist ./dist
|
|
COPY --from=builder /app/server ./server
|
|
COPY --from=builder /app/shared ./shared
|
|
COPY --from=builder /app/drizzle.config.ts ./
|
|
|
|
# Créer le dossier uploads
|
|
RUN mkdir -p uploads
|
|
|
|
# Exposer le port 5000
|
|
EXPOSE 5000
|
|
|
|
# Variables d'environnement par défaut
|
|
ENV NODE_ENV=production
|
|
ENV PORT=5000
|
|
|
|
# Démarrer l'application
|
|
CMD ["node", "dist/server.js"]
|