-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.yaml
104 lines (104 loc) · 2.71 KB
/
docker-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
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
services:
test-db:
image: "postgres:15.3"
tmpfs: "/var/lib/postgresql/data"
environment:
POSTGRES_USER: "devin"
POSTGRES_PASSWORD: "123456789"
POSTGRES_DB: "dzelda-db-test"
PGDATA: "/var/lib/postgresql/data"
POSTGRES_INITDB_ARGS: "--lc-collate=C"
ports:
- "54321:5432"
profiles:
- default
- dev
dev-db:
image: "postgres:15.3"
command: "postgres -c log_statement=all"
environment:
POSTGRES_USER: "devin"
POSTGRES_PASSWORD: "123456789"
POSTGRES_DB: "dzelda-db"
#TODO maybe use a different collation per query based on language, and update tests to match
#See https://stackoverflow.com/questions/62525260/what-is-the-best-way-to-replicate-postgresql-sorting-results-in-javascript
#and https://stackoverflow.com/questions/44055727/localecompare-when-testing-strings-sorted-in-en-us-utf8
POSTGRES_INITDB_ARGS: "--lc-collate=C"
volumes:
- "postgres-data:/var/lib/postgresql/data"
ports:
- "54320:5432"
profiles:
- default
- dev
email-server:
image: mailhog/mailhog
ports:
- "8025:8025" # Web interface for viewing emails
- "1025:1025" # SMTP server for receiving emails
profiles:
- default
- dev
server:
build:
dockerfile: backend.dockerfile
context: .
env_file:
- env/prod.env
environment:
PORT: 8080
ports:
- "8080:8080"
profiles:
- prod
parse-text-worker:
build:
dockerfile: backend.dockerfile
context: .
command: "node ./build/src/workers/parseNewTextWorker.js"
env_file:
- env/prod.env
depends_on:
rabbitmq:
condition: service_healthy
profiles:
- prod
nginx-proxy:
restart: unless-stopped
image: nginx:mainline-alpine
ports:
- "80:80"
- "443:443"
profiles:
- prod
depends_on:
- server
volumes:
- ./public/:/var/www/html
- ./nginx-conf:/etc/nginx/conf.d
- /etc/letsencrypt/live/backend.dzelda.com/fullchain.pem:/etc/nginx/ssl/fullchain.pem
- /etc/letsencrypt/live/backend.dzelda.com/privkey.pem:/etc/nginx/ssl/privkey.pem
rabbitmq:
image: 'rabbitmq:management'
hostname: rabbitmq-host
volumes:
- "./secret/rabbitmq.conf:/etc/rabbitmq/rabbitmq.conf"
- "rabbitmq-data:/var/lib/rabbitmq"
ports:
- '5672:5672' # RabbitMQ server
- '15672:15672' # RabbitMQ management UI
expose:
- 5672
profiles:
- default
- prod
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 20s
retries: 3
start_period: 3s
volumes:
postgres-data: null
certbot-etc: null
certbot-var: null
rabbitmq-data: null