quote-app/docker-compose.yml

127 lines
4.0 KiB
YAML
Raw Normal View History

services:
postgres:
image: postgres:16-alpine
container_name: quoteapp-postgres
restart: unless-stopped
environment:
POSTGRES_USER: quoteapp
POSTGRES_PASSWORD: quoteapp
POSTGRES_DB: quoteapp
ports:
- "127.0.0.1:5432:5432"
volumes:
- postgres_data:/var/lib/postgresql/data
- ./db/init.sql:/docker-entrypoint-initdb.d/01-init.sql:ro
healthcheck:
test: ["CMD-SHELL", "pg_isready -U quoteapp"]
interval: 5s
timeout: 5s
retries: 10
zitadel:
image: ghcr.io/zitadel/zitadel:latest
container_name: quoteapp-zitadel
restart: unless-stopped
command: 'start-from-init --masterkeyFromEnv --tlsMode external'
depends_on:
postgres:
condition: service_healthy
environment:
ZITADEL_MASTERKEY: ${ZITADEL_MASTERKEY}
ZITADEL_DATABASE_POSTGRES_HOST: postgres
ZITADEL_DATABASE_POSTGRES_PORT: "5432"
ZITADEL_DATABASE_POSTGRES_DATABASE: zitadel
ZITADEL_DATABASE_POSTGRES_USER_USERNAME: zitadel
ZITADEL_DATABASE_POSTGRES_USER_PASSWORD: ${ZITADEL_DB_PW}
ZITADEL_DATABASE_POSTGRES_USER_SSL_MODE: disable
ZITADEL_DATABASE_POSTGRES_ADMIN_USERNAME: quoteapp
ZITADEL_DATABASE_POSTGRES_ADMIN_PASSWORD: quoteapp
ZITADEL_DATABASE_POSTGRES_ADMIN_SSL_MODE: disable
ZITADEL_EXTERNALDOMAIN: ${PUBLIC_HOSTNAME}
ZITADEL_EXTERNALPORT: "8080"
ZITADEL_EXTERNALSECURE: "true"
ZITADEL_FIRSTINSTANCE_ORG_NAME: quoteapp
ZITADEL_FIRSTINSTANCE_ORG_MACHINE_MACHINE_USERNAME: bootstrap-admin
ZITADEL_FIRSTINSTANCE_ORG_MACHINE_MACHINE_NAME: Bootstrap Admin
ZITADEL_FIRSTINSTANCE_ORG_MACHINE_PAT_EXPIRATIONDATE: "2030-01-01T00:00:00Z"
ZITADEL_FIRSTINSTANCE_PATPATH: /bootstrap/admin.pat
ZITADEL_MACHINE_IDENTIFICATION_HOSTNAME_ENABLED: "true"
# Use the classic server-rendered login UI (bundled in this image) instead of
# Login V2, which ships as a separate Next.js app we don't deploy here.
ZITADEL_DEFAULTINSTANCE_FEATURES_LOGINV2_REQUIRED: "false"
ports:
- "8080:8080"
volumes:
- zitadel_bootstrap:/bootstrap
gitea:
image: gitea/gitea:1.22
container_name: quoteapp-gitea
restart: unless-stopped
environment:
GITEA__server__DOMAIN: ${PUBLIC_HOSTNAME}
GITEA__server__ROOT_URL: https://${PUBLIC_HOSTNAME}:3001/
GITEA__server__HTTP_PORT: 3000
GITEA__server__SSH_PORT: 2222
GITEA__security__INSTALL_LOCK: "true"
GITEA__service__DISABLE_REGISTRATION: "true"
GITEA__database__DB_TYPE: sqlite3
GITEA__actions__ENABLED: "true"
ports:
- "3001:3000"
- "127.0.0.1:2222:22"
volumes:
- gitea_data:/data
gitea-runner:
image: gitea/act_runner:latest
container_name: quoteapp-gitea-runner
restart: unless-stopped
depends_on:
- gitea
environment:
GITEA_INSTANCE_URL: http://gitea:3000
GITEA_RUNNER_REGISTRATION_TOKEN_FILE: /data/token
GITEA_RUNNER_NAME: vm-runner
CONFIG_FILE: /data/config.yaml
volumes:
- gitea_runner_data:/data
- ./gitea/runner-config.yaml:/data/config.yaml
- /var/run/docker.sock:/var/run/docker.sock
prometheus:
image: prom/prometheus:latest
container_name: quoteapp-prometheus
restart: unless-stopped
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./observability/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- prometheus_data:/prometheus
ports:
- "127.0.0.1:9090:9090"
grafana:
image: grafana/grafana:latest
container_name: quoteapp-grafana
restart: unless-stopped
environment:
GF_SECURITY_ADMIN_USER: admin
GF_SECURITY_ADMIN_PASSWORD: admin
GF_USERS_ALLOW_SIGN_UP: "false"
volumes:
- ./observability/grafana/provisioning:/etc/grafana/provisioning:ro
- grafana_data:/var/lib/grafana
ports:
- "3002:3000"
depends_on:
- prometheus
volumes:
postgres_data:
zitadel_bootstrap:
gitea_data:
gitea_runner_data:
prometheus_data:
grafana_data: