mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-14 17:01:05 +01:00
119 lines
3.7 KiB
Django/Jinja
119 lines
3.7 KiB
Django/Jinja
x-op-app: &app
|
|
logging:
|
|
driver: journald
|
|
image: custom_openproject
|
|
environment:
|
|
OPENPROJECT_HTTPS: "${OPENPROJECT_HTTPS}"
|
|
OPENPROJECT_HOST__NAME: "${OPENPROJECT_HOST__NAME}"
|
|
OPENPROJECT_HSTS: "${OPENPROJECT_HSTS:-true}"
|
|
RAILS_CACHE_STORE: "memcache"
|
|
OPENPROJECT_CACHE__MEMCACHE__SERVER: "cache:11211"
|
|
OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}"
|
|
DATABASE_URL: "${DATABASE_URL}"
|
|
RAILS_MIN_THREADS: ${RAILS_MIN_THREADS:-4}
|
|
RAILS_MAX_THREADS: ${RAILS_MAX_THREADS:-16}
|
|
# set to true to enable the email receiving feature. See ./docker/cron for more options
|
|
IMAP_ENABLED: "${IMAP_ENABLED:-false}"
|
|
volumes:
|
|
- "data:/var/openproject/assets"
|
|
- "{{dummy_volume}}:/var/openproject/pgdata" # This mount is unnecessary and just done to prevent anonymous volumes
|
|
|
|
services:
|
|
|
|
{% include 'templates/docker/services/' + database_type + '.yml.j2' %}
|
|
|
|
cache:
|
|
image: memcached
|
|
container_name: openproject-memcached
|
|
restart: {{docker_restart_policy}}
|
|
logging:
|
|
driver: journald
|
|
{% include 'templates/docker/container/networks.yml.j2' %}
|
|
|
|
proxy:
|
|
restart: {{docker_restart_policy}}
|
|
logging:
|
|
driver: journald
|
|
image: custom_openproject
|
|
container_name: openproject-proxy
|
|
command: "./docker/prod/proxy"
|
|
ports:
|
|
- "${PORT}:80"
|
|
environment:
|
|
APP_HOST: web
|
|
OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}"
|
|
depends_on:
|
|
- web
|
|
{% include 'templates/docker/container/networks.yml.j2' %}
|
|
volumes:
|
|
- "data:/var/openproject/assets"
|
|
- "{{dummy_volume}}:/var/openproject/pgdata" # This mount is unnecessary and just done to prevent anonymous volumes
|
|
|
|
web:
|
|
<<: *app
|
|
restart: {{docker_restart_policy}}
|
|
command: "./docker/prod/web"
|
|
container_name: openproject-web
|
|
{% include 'templates/docker/container/networks.yml.j2' %}
|
|
{% include 'templates/docker/container/depends-on-also-database.yml.j2' %}
|
|
cache:
|
|
condition: service_started
|
|
seeder:
|
|
condition: service_started
|
|
labels:
|
|
- autoheal=true
|
|
healthcheck:
|
|
test: ["CMD", "curl", "-f", "http://localhost:8080${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}/health_checks/default"]
|
|
interval: 10s
|
|
timeout: 3s
|
|
retries: 3
|
|
start_period: 30s
|
|
|
|
autoheal:
|
|
image: willfarrell/autoheal:1.2.0
|
|
container_name: openproject-autoheal
|
|
restart: {{docker_restart_policy}}
|
|
logging:
|
|
driver: journald
|
|
volumes:
|
|
- "/var/run/docker.sock:/var/run/docker.sock"
|
|
environment:
|
|
AUTOHEAL_CONTAINER_LABEL: autoheal
|
|
AUTOHEAL_START_PERIOD: 600
|
|
AUTOHEAL_INTERVAL: 30
|
|
|
|
worker:
|
|
<<: *app
|
|
restart: {{docker_restart_policy}}
|
|
command: "./docker/prod/worker"
|
|
container_name: openproject-worker
|
|
{% include 'templates/docker/container/networks.yml.j2' %}
|
|
{% include 'templates/docker/container/depends-on-also-database.yml.j2' %}
|
|
cache:
|
|
condition: service_started
|
|
seeder:
|
|
condition: service_started
|
|
|
|
cron:
|
|
<<: *app
|
|
restart: {{docker_restart_policy}}
|
|
command: "./docker/prod/cron"
|
|
container_name: openproject-cron
|
|
{% include 'templates/docker/container/networks.yml.j2' %}
|
|
{% include 'templates/docker/container/depends-on-also-database.yml.j2' %}
|
|
cache:
|
|
condition: service_started
|
|
seeder:
|
|
condition: service_started
|
|
|
|
seeder:
|
|
<<: *app
|
|
command: "./docker/prod/seeder"
|
|
container_name: openproject-seeder
|
|
restart: on-failure
|
|
{% include 'templates/docker/container/networks.yml.j2' %}
|
|
|
|
{% include 'templates/docker/compose/networks.yml.j2' %}
|
|
|
|
{% include 'templates/docker/compose/volumes.yml.j2' %}
|
|
data: |