Update docker-compose.yml and Dockerfile to simplify port configuration by removing quotes around port numbers and reintroducing the EXPOSE directive for the application service.

This commit is contained in:
Luke Hagar
2025-10-20 23:02:21 -05:00
parent 2fb9526c09
commit 4c21749c07
2 changed files with 5 additions and 4 deletions

View File

@@ -28,6 +28,8 @@ RUN bun run build
ENV NODE_ENV=production ENV NODE_ENV=production
EXPOSE 3000
# Default command can be overridden by compose # Default command can be overridden by compose
CMD ["bun", "run", "build/index.js"] CMD ["bun", "run", "build/index.js"]

View File

@@ -8,7 +8,7 @@ services:
volumes: volumes:
- pgdata:/var/lib/postgresql/data - pgdata:/var/lib/postgresql/data
ports: ports:
- "5432:5432" - 5432
healthcheck: healthcheck:
test: [ "CMD-SHELL", "pg_isready -U pypistats -d pypistats" ] test: [ "CMD-SHELL", "pg_isready -U pypistats -d pypistats" ]
interval: 5s interval: 5s
@@ -21,7 +21,7 @@ services:
REDIS_PASSWORD: ${REDIS_PASSWORD} REDIS_PASSWORD: ${REDIS_PASSWORD}
command: [ "redis-server", "--requirepass", "${REDIS_PASSWORD}" ] command: [ "redis-server", "--requirepass", "${REDIS_PASSWORD}" ]
ports: ports:
- "6379:6379" - 6379
healthcheck: healthcheck:
test: [ "CMD-SHELL", "redis-cli -a $REDIS_PASSWORD ping" ] test: [ "CMD-SHELL", "redis-cli -a $REDIS_PASSWORD ping" ]
interval: 5s interval: 5s
@@ -40,13 +40,12 @@ services:
condition: service_healthy condition: service_healthy
environment: environment:
NODE_ENV: production NODE_ENV: production
PORT: 3000
SERVICE_PASSWORD_POSTGRES: ${POSTGRES_PASSWORD} SERVICE_PASSWORD_POSTGRES: ${POSTGRES_PASSWORD}
SERVICE_PASSWORD_REDIS: ${REDIS_PASSWORD} SERVICE_PASSWORD_REDIS: ${REDIS_PASSWORD}
DATABASE_URL: postgresql://pypistats:${POSTGRES_PASSWORD}@db:5432/pypistats?schema=public DATABASE_URL: postgresql://pypistats:${POSTGRES_PASSWORD}@db:5432/pypistats?schema=public
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379 REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
ports: ports:
- "3000:3000" - 3000
command: [ "sh", "-c", "bun run prisma migrate deploy && bun run build/index.js" ] command: [ "sh", "-c", "bun run prisma migrate deploy && bun run build/index.js" ]
volumes: volumes: