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