Files
Grow/docker-compose.yml
T
arnaudne 750c2c2f60 fix(compose): use CMD form for pg_isready healthcheck, add start_period
CMD-SHELL drops pg_isready from PATH on some Alpine setups. Switch to
explicit CMD array form with -h 127.0.0.1. start_period gives postgres
time to initialize before failures count against retries.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-06-13 18:02:15 +02:00

56 lines
1.4 KiB
YAML

services:
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: grow
POSTGRES_USER: grow
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-changeme}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD", "pg_isready", "-U", "grow", "-d", "grow", "-h", "127.0.0.1"]
interval: 5s
timeout: 5s
retries: 20
start_period: 15s
app:
build: .
restart: unless-stopped
depends_on:
db:
condition: service_healthy
ports:
- "${PORT:-3000}:3000"
environment:
DATABASE_URL: "postgresql://grow:${POSTGRES_PASSWORD}@db:5432/grow"
NEXTAUTH_URL: ${NEXTAUTH_URL}
AUTH_SECRET: ${AUTH_SECRET}
SUPERADMIN_EMAIL: ${SUPERADMIN_EMAIL}
# Optional
SMTP_HOST: ${SMTP_HOST:-}
SMTP_PORT: ${SMTP_PORT:-587}
SMTP_USER: ${SMTP_USER:-}
SMTP_PASS: ${SMTP_PASS:-}
SMTP_FROM: ${SMTP_FROM:-}
PUSHOVER_APP_TOKEN: ${PUSHOVER_APP_TOKEN:-}
VAPID_PUBLIC_KEY: ${VAPID_PUBLIC_KEY:-}
VAPID_PRIVATE_KEY: ${VAPID_PRIVATE_KEY:-}
VAPID_SUBJECT: ${VAPID_SUBJECT:-}
migrate:
build:
context: .
target: builder
command: node_modules/.bin/prisma db push
depends_on:
db:
condition: service_healthy
environment:
DATABASE_URL: "postgresql://grow:${POSTGRES_PASSWORD}@db:5432/grow"
restart: "no"
volumes:
postgres_data: