-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
133 lines (125 loc) · 3.01 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
version: "3.8"
# name: barrierelos
services:
proxy:
image: geometalab/env-configurable-caddy:latest
networks:
- web
- default
environment:
CADDY_CONFIG: |
:8080 {
route {
handle /api/* {
uri strip_prefix /api
reverse_proxy backend:8030
}
redir /api /api/
reverse_proxy /* {
to frontend:5000
}
}
}
deploy:
labels:
# caddy: barrierelos.projects-ost.ch
caddy: barrierelos.sifs0003.infs.ch
caddy.reverse_proxy: "{{upstreams 8080}}"
restart_policy:
condition: "on-failure"
rabbitmq:
container_name: barrierelos-rabbitmq
image: rabbitmq:3-management
restart: always
volumes:
- rabbitmq-data-dir:/var/lib/rabbitmq/mnesia/
networks:
- default
hostname: rabbitmq
# expose:
# - 5672
# ports:
# - "15672:15672"
environment:
- RABBITMQ_DEFAULT_USER=$RABBITMQ_USER
- RABBITMQ_DEFAULT_PASS=$RABBITMQ_PASSWORD
healthcheck:
test: rabbitmq-diagnostics -q ping
interval: 10s
timeout: 3s
retries: 3
scanner:
container_name: barrierelos-scanner
image: $CONTAINER_REGISTRY_PATH/scanner:latest
restart: always
depends_on:
- rabbitmq
networks:
- default
environment:
- NODE_ENV=production
- RABBITMQ_HOSTNAME=rabbitmq
- RABBITMQ_PORT=5672
- RABBITMQ_USER=$RABBITMQ_USER
- RABBITMQ_PASSWORD=$RABBITMQ_PASSWORD
deploy:
resources:
limits:
cpus: "1"
database:
container_name: barrierelos-database
image: postgres:16.0
restart: always
# ports:
# - "5432:5432"
environment:
- POSTGRES_DB=barrierelos-db
- POSTGRES_USER=$POSTGRES_USER
- POSTGRES_PASSWORD=$POSTGRES_PASSWORD
volumes:
- barrierelos-data:/var/lib/postgresql/data/
networks:
- default
healthcheck:
test: pg_isready -d $${POSTGRES_DB} -U $${POSTGRES_USER}
interval: 10s
timeout: 3s
retries: 3
backend:
container_name: barrierelos-backend
image: $CONTAINER_REGISTRY_PATH/backend:latest
restart: always
# expose:
# - 8030
# ports:
# - "40001:8030"
networks:
- default
environment:
- RABBITMQ_USER=$RABBITMQ_USER
- RABBITMQ_PASSWORD=$RABBITMQ_PASSWORD
- SPRING_RABBITMQ_HOST=rabbitmq
- SPRING_RABBITMQ_PORT=5672
- POSTGRES_USER=$POSTGRES_USER
- POSTGRES_PASSWORD=$POSTGRES_PASSWORD
- SPRING_DATASOURCE_URL=jdbc:postgresql://database:5432/barrierelos-db?stringtype=unspecified
depends_on:
- database
- rabbitmq
frontend:
container_name: barrierelos-frontend
image: $CONTAINER_REGISTRY_PATH/frontend:latest
restart: always
networks:
- default
# ports:
# - "40000:5000"
depends_on:
- backend
volumes:
rabbitmq-data-dir:
barrierelos-data:
networks:
web:
external: true
name: web