-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
185 lines (174 loc) · 4.6 KB
/
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
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
version: "3.9"
services:
client:
image: ${REGISTRY_PATH}client:${VERSION:-latest}
container_name: or_client
build:
context: ./client
dockerfile: Dockerfile.client
tags:
- ${REGISTRY_PATH}client:${COMMIT_REF:-latest}
args:
- API_DOMAIN=${DOMAIN_NAME}
- GOOGLE_CLIENT_ID=${GOOGLE_CLIENT_ID}
- SENTRY_AUTH_TOKEN_ARG=${SENTRY_AUTH_TOKEN}
restart: unless-stopped
depends_on:
- django
- hasura
- caddy
networks:
- caddy_network
django:
image: ${REGISTRY_PATH}api:${VERSION:-latest}
container_name: or_django
build:
dockerfile: ./Dockerfile.api
tags:
- ${REGISTRY_PATH}api:${COMMIT_REF:-latest}
restart: unless-stopped
env_file:
- path: ./.env
required: false
environment:
- POSTGRES_HOST=db
depends_on:
- db
- caddy
networks:
- postgres_network
- caddy_network
- rabbitmq_network
- redis_network
worker:
image: ${REGISTRY_PATH}api:${VERSION:-latest}
container_name: or_worker
build:
dockerfile: ./Dockerfile.api
tags:
- ${REGISTRY_PATH}api:${COMMIT_REF:-latest}
command: python manage.py rundramatiq
restart: unless-stopped
env_file:
- path: ./.env
required: false
environment:
- POSTGRES_HOST=db
depends_on:
- db
- rabbitmq
networks:
- rabbitmq_network
- postgres_network
- caddy_network
caddy:
image: ${REGISTRY_PATH}caddy:${VERSION:-latest}
restart: unless-stopped
build:
context: ./caddy
dockerfile: Dockerfile.caddy
tags:
- ${REGISTRY_PATH}caddy:${COMMIT_REF:-latest}
volumes:
- caddy_data:/data
- caddy_config:/config
- ./caddy/cert.crt:/etc/pki/tls/certs/cert.crt
- ./caddy/cert.key:/etc/pki/tls/private/cert.key
environment:
- DOMAIN_NAME=${DOMAIN_NAME}
- TLS=${TLS}
- TLS_KEY=${TLS_KEY}
- RATE_LIMIT=${RATE_LIMIT}
container_name: or_caddy
ports:
- "80:80"
- "443:443"
networks:
- caddy_network
db:
image: postgis/postgis:16-master
container_name: or_database
volumes:
- postgres:/var/lib/postgresql/data
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
networks:
- postgres_network
rabbitmq:
image: rabbitmq:3-management
container_name: or_rabbitmq
restart: always
volumes:
- rabbitmq:/var/lib/rabbitmq
environment:
RABBITMQ_DEFAULT_USER: ${RABBITMQ_DEFAULT_USER}
RABBITMQ_DEFAULT_PASS: ${RABBITMQ_DEFAULT_PASS}
RABBITMQ_DEFAULT_VHOST: ${RABBITMQ_DEFAULT_VHOST}
networks:
- rabbitmq_network
- caddy_network
hasura:
image: ${REGISTRY_PATH}hasura:${VERSION:-latest}
container_name: or_hasura
build:
context: ./hasura
dockerfile: Dockerfile.hasura
tags:
- ${REGISTRY_PATH}hasura:${COMMIT_REF:-latest}
restart: unless-stopped
depends_on:
- "db"
- "django"
- "caddy"
environment:
HASURA_GRAPHQL_DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
HASURA_GRAPHQL_ENABLE_CONSOLE: "true"
HASURA_GRAPHQL_DEV_MODE: "false"
HASURA_GRAPHQL_ENABLED_LOG_TYPES: startup, http-log, webhook-log, websocket-log, query-log
HASURA_GRAPHQL_ADMIN_SECRET: ${HASURA_GRAPHQL_ADMIN_SECRET}
HASURA_GRAPHQL_JWT_SECRET: '{"type":"HS256","key":"${JWT_SECRET_KEY}","claims_namespace":"user_claims","claims_format":"json"}'
HASURA_GRAPHQL_UNAUTHORIZED_ROLE: "anonymous"
HASURA_GRAPHQL_MIGRATIONS_SERVER_TIMEOUT: 120
HASURA_GRAPHQL_CORS_DOMAIN: ${CSRF_TRUSTED_ORIGINS}
API_HOST: "http://django:9000"
extra_hosts:
- "host.docker.internal:host-gateway"
networks:
- postgres_network
- caddy_network
redis:
image: redis:7-alpine
container_name: or_redis
restart: unless-stopped
volumes:
- redis:/data
networks:
- redis_network
redis-commander:
image: rediscommander/redis-commander:latest
container_name: or_redis_commander
restart: unless-stopped
environment:
REDIS_HOSTS: "redis"
HTTP_USER: ${REDIS_COMMANDER_USER}
HTTP_PASSWORD: ${REDIS_COMMANDER_PASSWORD}
networks:
- caddy_network
- redis_network
networks:
caddy_network:
driver: bridge
redis_network:
driver: bridge
postgres_network:
driver: bridge
rabbitmq_network:
driver: bridge
volumes:
postgres:
rabbitmq:
caddy_data:
caddy_config:
redis: