-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathc3nav.docker-compose.yml
103 lines (95 loc) · 2.74 KB
/
c3nav.docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
# SPDX-FileCopyrightText: 2024 NOI Techpark
# SPDX-FileCopyrightText: 2024 https://github.com/c3nav/c3nav
#
# SPDX-License-Identifier: Apache-2.0
# Initially Copied from https://github.com/c3nav/c3nav/blob/034f8fe4633be3a982e94fd9e2f1fbc6d3dfafe1/deployment/docker/compose.yaml
x-restart-policy: &restart-policy
restart: unless-stopped
x-depends_on-default: &depends_on
condition: service_started
x-depends_on-healthy: &depends_on-healthy
condition: service_healthy
x-healthcheck_defaults: &healthcheck_defaults
interval: 10s
timeout: 2s
retries: 5
start_period: 5s
x-c3nav-defaults: &c3nav-defaults
image: ghcr.io/c3nav/c3nav:${C3NAV_TAG}
depends_on:
redis:
<<: *depends_on-healthy
postgres:
<<: *depends_on-healthy
volumes:
- type: bind
source: ${C3NAV_DOCKER_DATA_DIR:-./data}
target: /data
bind:
create_host_path: true
x-c3nav-environment: &c3nav-environment
C3NAV_DEBUG: false
C3NAV_LOGLEVEL: info
C3NAV_CONFIG: /data/c3nav.cfg
C3NAV_DATA_DIR: /data
C3NAV_DJANGO_ALLOWED_HOSTS: localhost,127.0.0.1,c3nav-core,c3nav-tiles,${C3NAV_DJANGO_ALLOWED_HOSTS:-""},${C3NAV_DOMAIN}
C3NAV_DJANGO_REVERSE_PROXY: "true"
UWSGI_WORKERS: ${C3NAV_CORE_WORKERS:-2}
C3NAV_DATABASE_BACKEND: postgresql
C3NAV_DATABASE_NAME: ${C3NAV_DATABASE_NAME:-c3nav}
C3NAV_DATABASE_USER: ${C3NAV_DATABASE_USER:-postgres}
C3NAV_DATABASE_HOST: postgres
C3NAV_REDIS: "redis://redis:6379/0"
C3NAV_CELERY_BROKER: "redis://redis:6379/1"
C3NAV_CELERY_BACKEND: "redis://redis:6379/2"
services:
c3nav-core:
<<: [*restart-policy, *c3nav-defaults]
command: webstatic-async
environment:
<<: *c3nav-environment
C3NAV_AUTOMIGRATE: yes
healthcheck:
<<: *healthcheck_defaults
test: curl -f http://localhost:8000/
ports:
- "${SERVER_PORT:-8000}:8000"
c3nav-workers:
<<: [*restart-policy, *c3nav-defaults]
command: worker
environment:
<<: *c3nav-environment
C3NAV_AUTOMIGRATE: no
healthcheck:
interval: 30s
timeout: 15s
retries: 2
start_period: 5s
test: entrypoint worker_healthcheck
postgres:
<<: *restart-policy
image: postgres:16
healthcheck:
<<: *healthcheck_defaults
test: pg_isready -U postgres
environment:
POSTGRES_DB: ${C3NAV_DATABASE_NAME:-c3nav}
POSTGRES_HOST_AUTH_METHOD: "trust"
volumes:
- "c3nav-postgres:/var/lib/postgresql/data"
redis:
<<: *restart-policy
image: redis:7.2
command: redis-server --save 60 1 --loglevel warning
healthcheck:
<<: *healthcheck_defaults
test: redis-cli ping
volumes:
- "c3nav-redis:/data"
ulimits:
nofile:
soft: 10032
hard: 10032
volumes:
c3nav-postgres:
c3nav-redis: