Files
Wyview/docker-compose.yml
2026-03-30 11:34:05 +02:00

69 lines
1.9 KiB
YAML

services:
postgres:
image: postgres:16-alpine
container_name: wyview-postgres
restart: unless-stopped
environment:
POSTGRES_USER: wyview
POSTGRES_PASSWORD: wyview
POSTGRES_DB: wyview
ports:
- "5433:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U wyview"]
interval: 10s
timeout: 5s
retries: 5
app:
build:
context: .
dockerfile: Dockerfile
args:
DATABASE_URL: postgresql://wyview:wyview@postgres:5432/wyview
image: marouette/wyview:latest
container_name: wyview-app
restart: unless-stopped
ports:
- "3001:3001"
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://wyview:wyview@postgres:5432/wyview
- AUTH_URL=${AUTH_URL}
- NEXT_PUBLIC_APP_URL=${NEXT_PUBLIC_APP_URL}
- NEXTAUTH_URL=${NEXTAUTH_URL}
- NEXTAUTH_SECRET=${NEXTAUTH_SECRET}
- AUTH_SECRET=${AUTH_SECRET}
- TIKTOK_CLIENT_KEY=${TIKTOK_CLIENT_KEY}
- TIKTOK_CLIENT_SECRET=${TIKTOK_CLIENT_SECRET}
- TIKTOK_REDIRECT_URI_PROD=${TIKTOK_REDIRECT_URI_PROD}
- TIKTOK_REDIRECT_URI_DEV=${TIKTOK_REDIRECT_URI_DEV}
depends_on:
postgres:
condition: service_healthy
command: sh -c "npx prisma migrate deploy && npm start"
worker:
build:
context: .
dockerfile: worker/Dockerfile
image: marouette/wyview-worker:latest
container_name: wyview-worker
restart: unless-stopped
environment:
- NODE_ENV=production
- DATABASE_URL=postgresql://wyview:wyview@postgres:5432/wyview
- TIKTOK_CLIENT_KEY=${TIKTOK_CLIENT_KEY}
- TIKTOK_CLIENT_SECRET=${TIKTOK_CLIENT_SECRET}
depends_on:
postgres:
condition: service_healthy
app:
condition: service_started
command: sh -c "sleep 30 && tsx worker/snapshot-worker.ts"
volumes:
postgres_data: