mirror of
https://github.com/R0m1k3/Socialflow.git
synced 2026-10-21 22:18:12 +02:00
Improve database migration and application startup processes
Update Dockerfile to generate database migrations, compile a migration script, and adjust the CMD for application startup. Modify docker-compose.yml to comment out PostgreSQL port exposure for security and update the command to run the new migration script. Add dependencies and a new migration script (server/migrate.ts) to handle database schema changes. Update INSTALLATION.md to reflect changes in database access and security recommendations. 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
This commit is contained in:
1 parent
33ffb9a8ed
commit
306a038afb
7 files changed
+177
-112
No files matched your search
+9
-2
@@ -12,9 +12,15 @@ RUN npm ci
|
||||
# Copier le reste du code source
|
||||
COPY . .
|
||||
|
||||
# Build du frontend
|
||||
# Générer les migrations de base de données
|
||||
RUN npx drizzle-kit generate || echo "No schema changes to generate"
|
||||
|
||||
# Build du frontend et backend
|
||||
RUN npm run build
|
||||
|
||||
# Compiler le script de migration
|
||||
RUN npx esbuild server/migrate.ts --platform=node --packages=external --bundle --format=esm --outfile=dist/migrate.js
|
||||
|
||||
# Étape 2: Image de production
|
||||
FROM node:20-alpine
|
||||
|
||||
@@ -29,6 +35,7 @@ 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 ./
|
||||
COPY --from=builder /app/drizzle ./drizzle
|
||||
|
||||
# Créer le dossier uploads
|
||||
RUN mkdir -p uploads
|
||||
@@ -41,4 +48,4 @@ ENV NODE_ENV=production
|
||||
ENV PORT=5000
|
||||
|
||||
# Démarrer l'application
|
||||
CMD ["node", "dist/server.js"]
|
||||
CMD ["npm", "run", "start"]
|
||||
Reference in new issue
Block a user