mirror of
https://github.com/LukeHagar/pypistats.dev.git
synced 2025-12-06 04:21:09 +00:00
53 lines
1.4 KiB
YAML
53 lines
1.4 KiB
YAML
services:
|
|
db:
|
|
image: postgres:latest
|
|
environment:
|
|
POSTGRES_DB: pypistats
|
|
POSTGRES_USER: pypistats
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
volumes:
|
|
- pgdata:/var/lib/postgresql/data
|
|
ports:
|
|
- 5432
|
|
healthcheck:
|
|
test: [ "CMD-SHELL", "pg_isready -U pypistats -d pypistats" ]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
|
|
redis:
|
|
image: redis:latest
|
|
environment:
|
|
REDIS_PASSWORD: ${REDIS_PASSWORD}
|
|
command: [ "redis-server", "--requirepass", "${REDIS_PASSWORD}" ]
|
|
ports:
|
|
- 6379
|
|
healthcheck:
|
|
test: [ "CMD-SHELL", "redis-cli -a $REDIS_PASSWORD ping" ]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
|
|
web:
|
|
build:
|
|
context: .
|
|
args:
|
|
DATABASE_URL: postgresql://pypistats:${POSTGRES_PASSWORD}@db:5432/pypistats?schema=public
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
redis:
|
|
condition: service_healthy
|
|
environment:
|
|
NODE_ENV: production
|
|
SERVICE_PASSWORD_POSTGRES: ${POSTGRES_PASSWORD}
|
|
SERVICE_PASSWORD_REDIS: ${REDIS_PASSWORD}
|
|
DATABASE_URL: postgresql://pypistats:${POSTGRES_PASSWORD}@db:5432/pypistats?schema=public
|
|
REDIS_URL: redis://:${REDIS_PASSWORD}@redis:6379
|
|
ports:
|
|
- 3000
|
|
command: [ "sh", "-c", "bun run prisma migrate deploy && bun run build/index.js" ]
|
|
|
|
volumes:
|
|
pgdata:
|