-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
99 lines (98 loc) · 2.35 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
version: '3.7'
services:
backend:
container_name: iotfreezer-backend
profiles:
- run
build:
context: .
ports:
- "127.0.0.1:${DOCKER_MAPPED_PORT}:${SERVER_PORT}"
command: yarn run start
env_file:
- ${ENV_FILE}
networks:
- webnet
depends_on:
- postgres
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
postgres:
container_name: iotfreezer-postgres
profiles:
- run
image: postgres:12
networks:
- webnet
environment:
POSTGRES_PASSWORD: ${TYPEORM_PASSWORD}
POSTGRES_USER: ${TYPEORM_USERNAME}
POSTGRES_DB: ${TYPEORM_DATABASE}
PG_DATA: /var/lib/postgresql/data
expose:
- ${TYPEORM_PORT} # Publishes 5433 to other containers but NOT to host machine
volumes:
- pgdata:/var/lib/postgresql/data
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
command: -p ${TYPEORM_PORT}
mosquitto:
container_name: iotfreezer-mosquitto
profiles:
- run
image: eclipse-mosquitto:latest
volumes:
- ./mosquitto.conf:/mosquitto/config/mosquitto.conf
ports:
- 1883:1883
networks:
- webnet
backendtest:
container_name: iotfreezer-backend-test
profiles:
- testing
build:
context: .
ports:
- "127.0.0.1:${DOCKER_MAPPED_PORT_TEST}:${SERVER_PORT}"
command: bash -c 'while !</dev/tcp/postgrestest/${TYPEORM_PORT}; do sleep 1; done; yarn run test'
env_file:
- ${ENV_FILE}
networks:
- webnet
depends_on:
- postgrestest
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
postgrestest:
container_name: postgrestest
profiles:
- testing
image: postgres:12
networks:
- webnet
environment:
POSTGRES_PASSWORD: ${TYPEORM_PASSWORD}
POSTGRES_USER: ${TYPEORM_USERNAME}
POSTGRES_DB: ${TYPEORM_DATABASE}
expose:
- ${TYPEORM_PORT} # Publishes 5433 to other containers but NOT to host machine
logging:
driver: "json-file"
options:
max-file: "5"
max-size: "10m"
command: -p ${TYPEORM_PORT}
networks:
webnet:
volumes:
pgdata: