services: web: build: . env_file: [.env] environment: APP_PORT: ${APP_PORT:-5000} APP_EXTERNAL_SCHEME: ${APP_EXTERNAL_SCHEME:-https} APP_EXTERNAL_HOST: ${APP_DOMAIN:-localhost} APP_EXTERNAL_PORT: ${EXPOSE_PORT:-8785} TZ: ${APP_TIMEZONE:-Europe/Warsaw} volumes: - ./:/app - ./db/sqlite:/app/db/sqlite depends_on: redis: condition: service_healthy postgres: condition: service_healthy required: false mysql: condition: service_healthy required: false restart: unless-stopped redis: image: redis:7-alpine ports: - "6379:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 20 restart: unless-stopped postgres: image: postgres:18-alpine profiles: ["pgsql"] environment: POSTGRES_DB: ${DB_NAME:-ksef} POSTGRES_USER: ${DB_USER:-ksef} POSTGRES_PASSWORD: ${DB_PASSWORD:-ksef} TZ: ${APP_TIMEZONE:-Europe/Warsaw} volumes: - ./db/pgsql:/var/lib/postgresql ports: - "${DB_PORT:-5432}:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U ${DB_USER:-ksef} -d ${DB_NAME:-ksef}"] interval: 5s timeout: 5s retries: 20 restart: unless-stopped mysql: image: mysql:8.4 profiles: ["mysql"] command: --default-authentication-plugin=mysql_native_password environment: MYSQL_DATABASE: ${DB_NAME:-ksef} MYSQL_USER: ${DB_USER:-ksef} MYSQL_PASSWORD: ${DB_PASSWORD:-ksef} MYSQL_ROOT_PASSWORD: ${MYSQL_ROOT_PASSWORD:-root} TZ: ${APP_TIMEZONE:-Europe/Warsaw} volumes: - ./db/mysql:/var/lib/mysql ports: - "${DB_PORT:-3306}:3306" healthcheck: test: ["CMD-SHELL", "mysqladmin ping -h 127.0.0.1 -uroot -p${MYSQL_ROOT_PASSWORD:-root} --silent"] interval: 5s timeout: 5s retries: 20 restart: unless-stopped caddy: image: caddy:2-alpine env_file: [.env] ports: - "${EXPOSE_PORT:-8785}:${EXPOSE_PORT:-8785}/tcp" - "${EXPOSE_PORT:-8785}:${EXPOSE_PORT:-8785}/udp" environment: APP_DOMAIN: ${APP_DOMAIN:-ksef.local} EXPOSE_PORT: ${EXPOSE_PORT:-8785} volumes: - ./deploy/caddy/Caddyfile:/etc/caddy/Caddyfile:ro - ./deploy/caddy/ssl:/certs:ro - caddy_data:/data - caddy_config:/config depends_on: - web restart: unless-stopped volumes: caddy_data: caddy_config: