Private
Public Access
227 lines
7.7 KiB
YAML
227 lines
7.7 KiB
YAML
services:
|
|
app:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
restart: unless-stopped
|
|
container_name: '${APP_NAME}-app'
|
|
ports:
|
|
- "${APP_PUBLISHED_PORT:-10080}:80"
|
|
environment:
|
|
SERVER_NAME: ${SERVER_NAME:-:80}
|
|
APP_ENV: prod
|
|
APP_VERSION: ${APP_VERSION:-1.0.0}
|
|
APP_SECRET: ${APP_SECRET}
|
|
APP_PUBLIC_HOSTNAME: ${APP_PUBLIC_HOSTNAME:-localhost}
|
|
APP_CONTACT_MAIL_ADDRESS: ${APP_CONTACT_MAIL_ADDRESS:-7system7@gmail.com}
|
|
DATABASE_URL: >-
|
|
postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?serverVersion=${POSTGRES_VERSION}&charset=utf8
|
|
POSTGRES_URL: db
|
|
POSTGRES_USER: ${POSTGRES_USER}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
POSTGRES_DB: ${POSTGRES_DB}
|
|
MERCURE_URL: http://localhost/.well-known/mercure
|
|
MERCURE_PUBLIC_URL: https://${APP_PUBLIC_HOSTNAME:-localhost}/.well-known/mercure
|
|
MERCURE_JWT_SECRET: ${MERCURE_JWT_SECRET}
|
|
MERCURE_JWT_TOKEN: ${MERCURE_JWT_TOKEN}
|
|
MERCURE_SUBSCRIBER_JWT: ${MERCURE_SUBSCRIBER_JWT}
|
|
MAILER_DSN: smtp://mail:25?verify_peer=0
|
|
CAP_API_ENDPOINT: ${CAP_API_ENDPOINT}
|
|
CAP_SECRET_KEY: ${CAP_SECRET_KEY}
|
|
WEBAUTHN_RP_ID: ${WEBAUTHN_RP_ID:-localhost}
|
|
WEBAUTHN_ORIGIN: ${WEBAUTHN_ORIGIN:-https://localhost}
|
|
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
|
|
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
|
|
MINIO_ENDPOINT: http://rustfs:9000
|
|
MINIO_PUBLIC_URL: ${MINIO_PUBLIC_URL:-http://localhost:9010}
|
|
# IMPORTANT: Set TRUSTED_PROXIES to your reverse proxy IP in production.
|
|
# For Docker on same host, use: 172.17.0.1 (default bridge) or 172.16.0.0/12 (overlay network)
|
|
# For Kubernetes or external proxy, use the proxy's IP address.
|
|
# WARNING: Using 0.0.0.0/0 is insecure in production environments!
|
|
TRUSTED_PROXIES: ${TRUSTED_PROXIES:-127.0.0.1}
|
|
volumes:
|
|
- app_var:/app/var
|
|
- caddy_data:/data
|
|
- caddy_config:/config
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "curl -fsS http://127.0.0.1/ -o /dev/null"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 12
|
|
start_period: 60s
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
mail:
|
|
condition: service_started
|
|
rustfs:
|
|
condition: service_healthy
|
|
storage_init:
|
|
condition: service_completed_successfully
|
|
scheduler:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
restart: unless-stopped
|
|
container_name: '${APP_NAME}-scheduler'
|
|
command: ['php', 'bin/console', 'messenger:consume', 'scheduler_default', '--env=prod', '--no-interaction', '--memory-limit=128M']
|
|
environment:
|
|
APP_ENV: prod
|
|
APP_SECRET: ${APP_SECRET}
|
|
APP_PUBLIC_HOSTNAME: ${APP_PUBLIC_HOSTNAME:-localhost}
|
|
DATABASE_URL: >-
|
|
postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}?serverVersion=${POSTGRES_VERSION}&charset=utf8
|
|
POSTGRES_URL: db
|
|
POSTGRES_USER: ${POSTGRES_USER}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
POSTGRES_DB: ${POSTGRES_DB}
|
|
MERCURE_URL: http://localhost/.well-known/mercure
|
|
MERCURE_PUBLIC_URL: https://${APP_PUBLIC_HOSTNAME:-localhost}/.well-known/mercure
|
|
MERCURE_JWT_SECRET: ${MERCURE_JWT_SECRET}
|
|
MERCURE_JWT_TOKEN: ${MERCURE_JWT_TOKEN}
|
|
MERCURE_SUBSCRIBER_JWT: ${MERCURE_SUBSCRIBER_JWT}
|
|
MAILER_DSN: smtp://mail:25?verify_peer=0
|
|
CAP_API_ENDPOINT: ${CAP_API_ENDPOINT}
|
|
CAP_SECRET_KEY: ${CAP_SECRET_KEY}
|
|
WEBAUTHN_RP_ID: ${WEBAUTHN_RP_ID:-localhost}
|
|
WEBAUTHN_ORIGIN: ${WEBAUTHN_ORIGIN:-https://localhost}
|
|
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
|
|
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
|
|
MINIO_ENDPOINT: http://rustfs:9000
|
|
MINIO_PUBLIC_URL: ${MINIO_PUBLIC_URL:-http://localhost:9010}
|
|
TRUSTED_PROXIES: ${TRUSTED_PROXIES:-127.0.0.1}
|
|
volumes:
|
|
- app_var:/app/var
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
mail:
|
|
condition: service_started
|
|
rustfs:
|
|
condition: service_healthy
|
|
storage_init:
|
|
condition: service_completed_successfully
|
|
healthcheck:
|
|
disable: true
|
|
|
|
rustfs:
|
|
image: rustfs/rustfs:1.0.3
|
|
restart: unless-stopped
|
|
container_name: '${APP_NAME}-rustfs'
|
|
environment:
|
|
RUSTFS_ACCESS_KEY: ${MINIO_ROOT_USER}
|
|
RUSTFS_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
|
|
RUSTFS_ADDRESS: ':9000'
|
|
RUSTFS_CONSOLE_ADDRESS: ':9001'
|
|
RUSTFS_CONSOLE_ENABLE: 'true'
|
|
volumes:
|
|
- rustfs_data:/data
|
|
ports:
|
|
- "${RUSTFS_PUBLISHED_API_PORT:-9010}:9000"
|
|
- "${RUSTFS_PUBLISHED_CONSOLE_PORT:-9011}:9001"
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9000/health"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
start_period: 15s
|
|
storage_init:
|
|
build:
|
|
context: ./docker/storage-migrate
|
|
entrypoint: ["python"]
|
|
command: ["/usr/local/bin/storage-init.py"]
|
|
restart: "no"
|
|
container_name: '${APP_NAME}-storage-init'
|
|
depends_on:
|
|
rustfs:
|
|
condition: service_healthy
|
|
environment:
|
|
TARGET_ENDPOINT: http://rustfs:9000
|
|
STORAGE_ACCESS_KEY: ${MINIO_ROOT_USER}
|
|
STORAGE_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
|
|
STORAGE_BUCKET: mineseeker
|
|
minio:
|
|
profiles: ["storage-migration"]
|
|
image: ${MINIO_IMAGE:-minio/minio:RELEASE.2025-09-07T16-13-09Z-cpuv1}
|
|
pull_policy: never
|
|
restart: unless-stopped
|
|
container_name: '${APP_NAME}-minio'
|
|
command: server /data --console-address ":9001"
|
|
ports:
|
|
- "${MINIO_PUBLISHED_API_PORT:-9012}:9000"
|
|
- "${MINIO_PUBLISHED_CONSOLE_PORT:-9013}:9001"
|
|
environment:
|
|
MINIO_ROOT_USER: ${MINIO_ROOT_USER}
|
|
MINIO_ROOT_PASSWORD: ${MINIO_ROOT_PASSWORD}
|
|
volumes:
|
|
- minio_data:/data
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 10
|
|
start_period: 10s
|
|
storage_migrate:
|
|
profiles: ["storage-migration"]
|
|
build:
|
|
context: ./docker/storage-migrate
|
|
restart: "no"
|
|
container_name: '${APP_NAME}-storage-migrate'
|
|
depends_on:
|
|
minio:
|
|
condition: service_healthy
|
|
rustfs:
|
|
condition: service_healthy
|
|
environment:
|
|
SOURCE_ENDPOINT: http://minio:9000
|
|
TARGET_ENDPOINT: http://rustfs:9000
|
|
STORAGE_ACCESS_KEY: ${MINIO_ROOT_USER}
|
|
STORAGE_SECRET_KEY: ${MINIO_ROOT_PASSWORD}
|
|
STORAGE_BUCKET: mineseeker
|
|
volumes:
|
|
- storage_migration_state:/state
|
|
mail:
|
|
image: boky/postfix:latest
|
|
restart: unless-stopped
|
|
container_name: '${APP_NAME}-mail'
|
|
hostname: postfix.mail.${MAIL_DOMAIN:-localhost}
|
|
environment:
|
|
ALLOWED_SENDER_DOMAINS: ${MAIL_DOMAIN:-localhost}
|
|
HOSTNAME: postfix.mail.${MAIL_DOMAIN:-localhost}
|
|
POSTFIX_myhostname: postfix.mail.${MAIL_DOMAIN:-localhost}
|
|
POSTFIX_mynetworks: "127.0.0.0/8 10.0.0.0/8 172.16.0.0/12 192.168.0.0/16"
|
|
POSTFIX_smtpd_tls_security_level: none
|
|
RELAYHOST: ${MAIL_RELAYHOST:-}
|
|
RELAYHOST_AUTH: ${MAIL_RELAYHOST_AUTH:-}
|
|
RELAYHOST_PASSWORD: ${MAIL_RELAYHOST_PASSWORD:-}
|
|
volumes:
|
|
- postfix_spool:/var/spool/postfix
|
|
- ./docker/aliases:/tmp/aliases:ro
|
|
db:
|
|
image: postgres:${POSTGRES_VERSION:-18}-alpine
|
|
restart: unless-stopped
|
|
container_name: '${APP_NAME}-db'
|
|
environment:
|
|
POSTGRES_USER: ${POSTGRES_USER}
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
|
|
POSTGRES_DB: ${POSTGRES_DB}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql
|
|
healthcheck:
|
|
test: [ "CMD-SHELL", "pg_isready -U $${POSTGRES_USER} -d $${POSTGRES_DB}" ]
|
|
interval: 5s
|
|
timeout: 3s
|
|
retries: 10
|
|
start_period: 10s
|
|
ports:
|
|
- "${POSTGRES_PUBLISHED_PORT:-5452}:5432"
|
|
volumes:
|
|
app_var:
|
|
postgres_data:
|
|
caddy_data:
|
|
caddy_config:
|
|
postfix_spool:
|
|
minio_data:
|
|
rustfs_data:
|
|
storage_migration_state:
|