Dokploy's managed Postgres runs as its own service on the shared `dokploy-network`. The compose stack only had its own default network, so web and worker could not resolve the database host — `prisma migrate deploy` failed on boot and both containers crash-looped. Join both services to `dokploy-network` while keeping `default` for web<->worker traffic. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
60 lines
2.1 KiB
YAML
60 lines
2.1 KiB
YAML
# Dokploy "Compose" application. Two services share one image + a storage volume.
|
|
# Set the env vars in Dokploy's Environment tab (they populate the .env Dokploy
|
|
# generates, which feeds both the build args and runtime env below).
|
|
services:
|
|
web:
|
|
build:
|
|
context: .
|
|
args:
|
|
NEXT_PUBLIC_APP_URL: ${NEXT_PUBLIC_APP_URL}
|
|
NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY: ${NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY}
|
|
NEXT_PUBLIC_TURNSTILE_SITE_KEY: ${NEXT_PUBLIC_TURNSTILE_SITE_KEY}
|
|
NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION: ${NEXT_PUBLIC_GOOGLE_SITE_VERIFICATION:-}
|
|
NEXT_PUBLIC_BING_SITE_VERIFICATION: ${NEXT_PUBLIC_BING_SITE_VERIFICATION:-}
|
|
UMAMI_HOST_URL: ${UMAMI_HOST_URL:-}
|
|
UMAMI_WEBSITE_ID: ${UMAMI_WEBSITE_ID:-}
|
|
image: podcast-distribution-ai:latest
|
|
# Apply pending migrations on boot, then serve.
|
|
command: sh -c "npx prisma migrate deploy && npm run start"
|
|
restart: unless-stopped
|
|
environment:
|
|
STORAGE_DIR: /app/storage
|
|
PORT: "3000"
|
|
# Also needed at run time, not just as build args: the app and admin route
|
|
# groups are `force-dynamic`, so the root layout re-reads these on every
|
|
# request rather than using the value baked into the prerendered HTML.
|
|
UMAMI_HOST_URL: ${UMAMI_HOST_URL:-}
|
|
UMAMI_WEBSITE_ID: ${UMAMI_WEBSITE_ID:-}
|
|
volumes:
|
|
- storage:/app/storage
|
|
# `default` keeps web<->worker talking; `dokploy-network` is where Dokploy's
|
|
# managed Postgres service lives, so Prisma can resolve the DB host.
|
|
networks:
|
|
- default
|
|
- dokploy-network
|
|
expose:
|
|
- "3000"
|
|
# Dokploy attaches the Traefik router (domain + SSL) to this service on port 3000.
|
|
|
|
worker:
|
|
image: podcast-distribution-ai:latest
|
|
command: npx tsx worker/index.ts
|
|
restart: unless-stopped
|
|
environment:
|
|
STORAGE_DIR: /app/storage
|
|
volumes:
|
|
- storage:/app/storage
|
|
networks:
|
|
- default
|
|
- dokploy-network
|
|
depends_on:
|
|
- web
|
|
|
|
volumes:
|
|
storage:
|
|
|
|
# Created by Dokploy; every managed service (incl. Postgres) is attached to it.
|
|
networks:
|
|
dokploy-network:
|
|
external: true
|