mirror of
https://github.com/R0m1k3/LogiFlow.git
synced 2026-10-20 21:49:07 +02:00
Automate database table creation during Docker updates
Add scripts and Dockerfile modifications to ensure database tables are automatically created or updated when the Docker image is rebuilt and deployed. Replit-Commit-Author: Agent Replit-Commit-Session-Id: e437ffed-c31b-44eb-9fd5-b6f9faa8e7ce Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/1957c339-2757-4d1f-8e92-e9f71a1ce58e/e437ffed-c31b-44eb-9fd5-b6f9faa8e7ce/biGr9ER
This commit is contained in:
1 parent
e8007d52b1
commit
74e7eb8118
7 files changed
+381
-2
No files matched your search
+10
-1
@@ -81,6 +81,9 @@ RUN npm ci --only=production && npm cache clean --force
|
||||
COPY --from=build --chown=nextjs:nodejs /app/dist ./dist
|
||||
COPY --from=build --chown=nextjs:nodejs /app/shared ./shared
|
||||
|
||||
# Copy migration scripts
|
||||
COPY --chown=nextjs:nodejs scripts/ ./scripts/
|
||||
|
||||
# Create symlink for public files to be accessible from dist
|
||||
RUN ln -sf /app/dist/public /app/dist/public
|
||||
|
||||
@@ -103,5 +106,11 @@ USER nextjs
|
||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
|
||||
CMD wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1
|
||||
|
||||
# Start the application
|
||||
# Copy and set entrypoint script
|
||||
COPY --chown=nextjs:nodejs scripts/docker-entrypoint.sh ./
|
||||
RUN chmod +x /app/scripts/auto-migrate-production.sh && \
|
||||
chmod +x /app/docker-entrypoint.sh
|
||||
|
||||
# Start the application with migration
|
||||
ENTRYPOINT ["/app/docker-entrypoint.sh"]
|
||||
CMD ["node", "dist/index.js"]
|
||||
Reference in new issue
Block a user