Files
kompress_eshop/docker-compose.prod.yml
filipriec 7900b7e176
Some checks failed
CI / Check Style (push) Has been cancelled
CI / Run Clippy (push) Has been cancelled
CI / Run Tests (push) Has been cancelled
prod changes
2026-06-30 23:08:00 +00:00

65 lines
1.9 KiB
YAML

services:
kompress:
container_name: kompress
build:
context: .
dockerfile: Dockerfile
env_file:
- .env.production
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB}
JWT_SECRET: "${JWT_SECRET:?JWT_SECRET must be set}"
OAUTH_CLIENT_SECRET: "${OAUTH_CLIENT_SECRET:?OAUTH_CLIENT_SECRET must be set}"
SMTP_PASSWORD: "${SMTP_PASSWORD:?SMTP_PASSWORD must be set}"
ADMIN_PASSWORD: "${ADMIN_PASSWORD:?ADMIN_PASSWORD must be set}"
volumes:
- ./config:/usr/app/config:ro
- kompress_eshop_data:/usr/app/data
networks:
- kompress_eshop-net
restart: unless-stopped
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD-SHELL", "curl -fsS http://localhost:5150/_ping"]
interval: 30s
timeout: 5s
retries: 3
start_period: 20s
command: ["start"]
postgres:
image: postgres:16-alpine
container_name: kompress-postgres
env_file:
- .env.production
environment:
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
networks:
- kompress_eshop-net
restart: unless-stopped
healthcheck:
test: ["CMD-SHELL", "pg_isready -U \"$${POSTGRES_USER}\" -d \"$${POSTGRES_DB}\""]
interval: 10s
timeout: 5s
retries: 5
# External network shared with the central Caddy (docker-compose.caddy.yml).
# Create it once on the host: docker network create kompress_eshop-net
# Then add it to the caddy service's `networks:` list so Caddy can reach
# `kompress:5150` by container name — exactly like gitea-net etc.
networks:
kompress_eshop-net:
external: true
volumes:
kompress_eshop_data:
name: kompress_eshop_data
postgres_data:
name: kompress_postgres_data