mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-14 00:41:06 +01:00
128 lines
3.0 KiB
Django/Jinja
128 lines
3.0 KiB
Django/Jinja
version: "3.7"
|
|
|
|
networks:
|
|
frontend:
|
|
backend:
|
|
|
|
volumes:
|
|
{% if not ( enable_central_database | lower | bool ) %}
|
|
database:
|
|
{% endif %}
|
|
data:
|
|
|
|
x-op-restart-policy: &restart_policy
|
|
restart: unless-stopped
|
|
x-op-image: &image
|
|
image: openproject/community:${TAG:-13}
|
|
x-op-app: &app
|
|
<<: [*image, *restart_policy]
|
|
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"
|
|
{% if not ( enable_central_database | lower | bool ) %}
|
|
- "database:/var/openproject/pgdata"
|
|
{% endif %}
|
|
|
|
services:
|
|
|
|
{% if not ( enable_central_database | lower | bool ) %}
|
|
{% include 'templates/docker-postgres-service.yml.j2' %}
|
|
{% endif %}
|
|
networks:
|
|
- backend
|
|
|
|
cache:
|
|
image: memcached
|
|
<<: *restart_policy
|
|
networks:
|
|
- backend
|
|
|
|
proxy:
|
|
<<: [*image, *restart_policy]
|
|
command: "./docker/prod/proxy"
|
|
ports:
|
|
- "${PORT}:80"
|
|
environment:
|
|
APP_HOST: web
|
|
OPENPROJECT_RAILS__RELATIVE__URL__ROOT: "${OPENPROJECT_RAILS__RELATIVE__URL__ROOT:-}"
|
|
depends_on:
|
|
- web
|
|
networks:
|
|
- frontend
|
|
volumes:
|
|
- "data:/var/openproject/assets"
|
|
{% if not ( enable_central_database | lower | bool ) %}
|
|
- "database:/var/openproject/pgdata"
|
|
{% endif %}
|
|
|
|
web:
|
|
<<: *app
|
|
command: "./docker/prod/web"
|
|
networks:
|
|
- frontend
|
|
- backend
|
|
depends_on:
|
|
{% if not ( enable_central_database | lower | bool ) %}
|
|
- database
|
|
{% endif %}
|
|
- cache
|
|
- seeder
|
|
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
|
|
volumes:
|
|
- "/var/run/docker.sock:/var/run/docker.sock"
|
|
environment:
|
|
AUTOHEAL_CONTAINER_LABEL: autoheal
|
|
AUTOHEAL_START_PERIOD: 600
|
|
AUTOHEAL_INTERVAL: 30
|
|
|
|
worker:
|
|
<<: *app
|
|
command: "./docker/prod/worker"
|
|
networks:
|
|
- backend
|
|
depends_on:
|
|
{% if not ( enable_central_database | lower | bool ) %}
|
|
- database
|
|
{% endif %}
|
|
- cache
|
|
- seeder
|
|
|
|
cron:
|
|
<<: *app
|
|
command: "./docker/prod/cron"
|
|
networks:
|
|
- backend
|
|
depends_on:
|
|
{% if not ( enable_central_database | lower | bool ) %}
|
|
- database
|
|
{% endif %}
|
|
- cache
|
|
- seeder
|
|
|
|
seeder:
|
|
<<: *app
|
|
command: "./docker/prod/seeder"
|
|
restart: on-failure
|
|
networks:
|
|
- backend |