-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathdocker-compose.yml
145 lines (144 loc) · 3.88 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
services:
router:
image: busybox
command: "sleep infinity"
init: true
# note: frontend, backend and minio have network_mode: service:router
# because they to reach backend and minio at same address as browser
# cannot publish ports from container that has this network_mode
# also need to use separate router container so backend can restart
# without breaking connectivity
# see #357 #375 #408
ports:
- 3000:3000
- 7998:7998
- 8000:8000
- 9000:9000
# minio console, uncomment if you need it
# - 9001:9001
backend:
build: backend
init: true
command: python manage.py docker_start
restart: unless-stopped
network_mode: service:router
depends_on:
- redis
- postgres
volumes: &volumes
- ./backend:/usr/src/app
- ./dev-secrets:/usr/src/app/dev-secrets:rw
tmpfs:
- /tmp
environment: &environment
PYTHONUNBUFFERED: 1
DEBUG: 1
BROKER_URL: redis://redis/1
CACHE_URL: rediscache://redis/1
ALLOWED_HOSTS: "*"
MINIO_BUCKET_NAME: kompassi
MINIO_ACCESS_KEY_ID: kompassi
MINIO_SECRET_ACCESS_KEY: kompassi
MINIO_ENDPOINT_URL: http://localhost:9000
KOMPASSI_GENERATE_OIDC_RSA_PRIVATE_KEY_PATH: dev-secrets/id_rsa.key
SECRET_KEY: The SECRET_KEY setting must not be empty.
KOMPASSI_BASE_URL: http://localhost:8000
TICKETS_BASE_URL: http://localhost:7998
KOMPASSI_V2_BASE_URL: http://localhost:3000
KOMPASSI_TICKETS_V2_API_KEY: secret
uvicorn:
build: backend
init: true
command:
- uvicorn
- --workers=8
- --host=0.0.0.0
- --port=7998
- --no-access-log
- tickets_v2.optimized_server.app:app
network_mode: service:router
depends_on:
- postgres
volumes: *volumes
environment: *environment
celery:
build: backend
init: true
command: celery -A kompassi.celery_app:app worker
depends_on:
- redis
- postgres
volumes: *volumes
tmpfs:
- /tmp
environment: *environment
# TODO replace celery with a more sensible solution
# until then, tickets_v2 has its own worker
worker:
build: backend
init: true
restart: unless-stopped
command:
- python
- manage.py
- tickets_v2_worker
network_mode: service:router
depends_on:
- postgres
volumes: *volumes
environment: *environment
frontend:
build:
context: frontend
dockerfile: dev.Dockerfile
init: true
network_mode: service:router
depends_on:
- backend
volumes:
- ./frontend/src:/usr/src/app/src
environment:
NEXT_PUBLIC_KOMPASSI_BASE_URL: http://localhost:8000
NEXT_PUBLIC_TICKETS_BASE_URL: http://localhost:7998
NEXTAUTH_URL: http://localhost:3000
NEXTAUTH_SECRET: eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
KOMPASSI_TICKETS_V2_API_KEY: secret
postgres:
# image: postgres
build: backend/kompassi/sql/
init: true
command:
- postgres
- -c
- shared_preload_libraries=pg_stat_statements
# uncomment if you need to access postgres from host
# note: you can use `docker compose exec postgres psql -U kompassi` to access psql cli
# ports:
# - 5433:5432
volumes:
- postgres-data:/var/lib/postgresql/data
# tmpfs:
# - /var/lib/postgresql/data
environment:
POSTGRES_USER: kompassi
POSTGRES_PASSWORD: secret
POSTGRES_DB: kompassi
redis:
image: redis
init: true
volumes:
- redis-data:/data
minio:
image: minio/minio
entrypoint: /usr/bin/env
command: sh -c 'mkdir -p /data/kompassi && minio server /data --console-address ":9001"'
network_mode: service:router
volumes:
- minio-data:/data
environment:
MINIO_ROOT_USER: kompassi
MINIO_ROOT_PASSWORD: kompassi
volumes:
postgres-data: {}
redis-data: {}
minio-data: {}