forked from digital-peaks/web-aoa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
116 lines (110 loc) · 2.55 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
105
106
107
108
109
110
111
112
113
114
115
116
version: "3.9"
services:
frontend:
image: nschnierer/digital-peaks-web-aoa-frontend:latest
container_name: "frontend"
environment:
- NODE_ENV
- API_URL
networks:
- default
api:
image: nschnierer/digital-peaks-web-aoa-api:latest
container_name: "api"
build:
context: .
dockerfile: ./Dockerfile
command: ["$API_COMMAND"]
environment:
- EXPRESS_PORT=9000
- NODE_ENV
- MONGODB_CONNECTION_STRING
- JWT_SECRET
- API_KEY
- MAX_UPLOAD_FILE_SIZE_MB
- API_URL
volumes:
- ./src:/app/src:ro
- ./package.json:/app/package.json:ro
- ./r:/app/r
- ./jobs:/app/jobs
networks:
- default
depends_on:
- mongodb
mongodb:
image: mongo
container_name: "mongodb"
restart: always
ports:
- "27017-27019:27017-27019"
environment:
- MONGO_INITDB_ROOT_USERNAME
- MONGO_INITDB_ROOT_PASSWORD
- MONGO_INITDB_DATABASE
# will be used by the init-mongo.js file
- MONGO_INITDB_API_USERNAME
- MONGO_INITDB_API_PASSWORD
volumes:
- ./mongo/init-mongo.js:/docker-entrypoint-initdb.d/init-mongo.js:ro
- ./mongo/volume:/data/db
networks:
- default
haproxy:
image: haproxy:2.5
ports:
- "${HAPROXY_PORT:-80}:8080"
volumes:
- ./ops/haproxy:/etc/haproxy/configs:ro
- ${HAPROXY_CERT:-./ops/haproxy/cert.pem}:/etc/ssl/cert.pem:ro
command:
[
"haproxy",
"-f",
"/etc/haproxy/configs/haproxy.cfg",
"-f",
"/etc/haproxy/configs/haproxy.${HAPROXY_CONFIG:-local}.cfg",
]
depends_on:
- api
- frontend
migration:
profiles:
- migration
image: node:16-alpine
container_name: "migration"
restart: always
command: ["node", "/migration/create-user.js"]
environment:
- API_HOST=api
- EXPRESS_PORT=9000
- API_KEY
volumes:
- ./migration/create-user.js:/migration/create-user.js:ro
networks:
- default
depends_on:
- api
tests_unit:
profiles:
- tests
container_name: "tests_unit"
image: nschnierer/digital-peaks-web-aoa-api:latest
build:
context: .
dockerfile: ./Dockerfile
command: ["test:unit"]
environment:
- EXPRESS_PORT=9000
- NODE_ENV
- MONGODB_CONNECTION_STRING
- JWT_SECRET
- API_KEY
- MAX_UPLOAD_FILE_SIZE_MB
- API_URL
volumes:
- ./src:/app/src:ro
- ./package.json:/app/package.json:ro
networks:
default:
driver: bridge