fix: run db migrations on startup in production
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-12-15 16:05:53 +01:00
parent aa5f2328f7
commit cd7707a725
4 changed files with 10 additions and 8 deletions
+2 -1
View File
@@ -48,4 +48,5 @@ HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD node -e "require('http').get('http://localhost:5000/api/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})"
# Start the application using tsx to run TypeScript directly
CMD ["npx", "tsx", "server/index.ts"]
# Run DB migrations and start the application
CMD ["sh", "-c", "npx drizzle-kit push && npx tsx server/index.ts"]
+3 -2
View File
@@ -10,7 +10,7 @@ services:
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
volumes:
- /mnt/DockerMount/task-manager/data:/var/lib/postgresql/data
- /mnt/DockerMount/taskmanager/data:/var/lib/postgresql/data
ports:
- "${POSTGRES_PORT:-5432}:5432"
healthcheck:
@@ -30,7 +30,8 @@ services:
PORT: 5000
SESSION_SECRET: ${SESSION_SECRET}
depends_on:
- postgres
postgres:
condition: service_healthy
healthcheck:
test: [ "CMD", "node", "-e", "require('http').get('http://localhost:5000/api/health', (r) => {process.exit(r.statusCode === 200 ? 0 : 1)})" ]
interval: 30s
+2 -2
View File
@@ -1,12 +1,12 @@
{
"name": "rest-express",
"version": "1.0.1",
"version": "1.0.2",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "rest-express",
"version": "1.0.1",
"version": "1.0.2",
"license": "MIT",
"dependencies": {
"@dnd-kit/core": "^6.3.1",
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "rest-express",
"version": "1.0.1",
"version": "1.0.2",
"type": "module",
"license": "MIT",
"scripts": {