mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-12 01:36:54 +02:00
Modify Dockerfile and docker-compose.yml to use `npx drizzle-kit push --force` for database migrations, resolving "Can't find meta/_journal.json" errors and ensuring correct schema application. Replit-Commit-Author: Agent Replit-Commit-Session-Id: ae4037a0-2a6f-4530-9bac-79b543286bda Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/397bca8c-984f-43ff-841a-10897aeb8140/ae4037a0-2a6f-4530-9bac-79b543286bda/Yxw6kHP
42 lines
858 B
Docker
42 lines
858 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 et backend
|
|
RUN npm run build
|
|
|
|
# Étape 2: Image de production
|
|
FROM node:20-alpine
|
|
|
|
WORKDIR /app
|
|
|
|
# Installer toutes les dépendances (drizzle-kit est nécessaire pour push)
|
|
COPY package*.json ./
|
|
RUN npm ci
|
|
|
|
# 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 ./
|
|
|
|
# Exposer le port 5555
|
|
EXPOSE 5555
|
|
|
|
# Variables d'environnement par défaut
|
|
ENV NODE_ENV=production
|
|
ENV PORT=5555
|
|
|
|
# Démarrer l'application
|
|
CMD ["npm", "run", "start"]
|