-
Notifications
You must be signed in to change notification settings - Fork 0
/
compose.yaml
73 lines (66 loc) · 1.71 KB
/
compose.yaml
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
version: "3.9"
services:
db:
# Pulled Feb 16, 2023
image: postgres:15@sha256:901df890146ec46a5cab7a33f4ac84e81bac2fe92b2c9a14fd649502c4adf954
environment:
POSTGRES_PASSWORD: "123456"
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready --username=postgres"]
interval: 5s
timeout: 10s
retries: 5
start_period: 80s
migrate:
image: dear-diary
build: .
restart: on-failure
environment: &commonenv
DJANGO_SECRET_KEY: "#-@^btdzoe9n-swq=fx5(db5^ibkqsytrt0ie2n55efz7wtpk#"
DEBUG: "True"
DJANGO_DATABASE_ENGINE: "postgres"
DJANGO_DATABASE_NAME: "postgres"
DJANGO_DATABASE_USER: "postgres"
DJANGO_DATABASE_PASSWORD: "123456"
DJANGO_DATABASE_HOST: "db"
DJANGO_DATABASE_PORT: "5432"
DJANGO_ALLOWED_HOSTS: "*"
DJANGO_CSRF_TRUSTED_ORIGINS: "http://localhost:8000"
depends_on: &dependsondb
db:
condition: service_healthy
command: ["migrate"]
nginx:
image: dear-diary-nginx
build:
context: .
dockerfile: nginx.Dockerfile
web:
image: dear-diary
build: .
environment:
<<: *commonenv
depends_on: *dependsondb
command: ["web"]
ingress:
# Pulled Feb 16, 2023
image: nginx@sha256:6650513efd1d27c1f8a5351cbd33edf85cc7e0d9d0fcb4ffb23d8fa89b601ba8
volumes:
- ./ingress-nginx-default.conf:/etc/nginx/conf.d/default.conf
ports:
- "8000:80"
depends_on:
- nginx
- web
qcluster:
image: dear-diary
build: .
environment:
<<: *commonenv
DJANGO_Q_CLUSTER_SETTINGS_JSON: '{"workers": 2}'
depends_on: *dependsondb
command: ["qcluster"]
volumes:
pgdata: