-
Notifications
You must be signed in to change notification settings - Fork 51
/
docker-compose.yml
101 lines (91 loc) · 2.21 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
version: "3.8"
services:
wikonnect-postgres:
container_name: postgres
image: "postgres"
restart: always
volumes:
- ./data/postgres/:/var/lib/postgresql/data/
env_file: .env
ports:
- "${POSTGRES_PORT}:${POSTGRES_PORT}"
networks:
- wikonnect
healthcheck:
test: [ "CMD-SHELL", "pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}" ]
interval: 10s
timeout: 5s
retries: 5
# Uncomment this if you need to enable elastic search.
# Don't forget to also uncomment server service dependencies & at volumes level
# wikonnect-elastic:
# container_name: elasticsearch
# image: 'elasticsearch:7.11.1'
# restart: "always"
# volumes:
# - elasticsearch:/usr/share/elasticsearch/data
# ports:
# - '9200'
# environment:
# - discovery.type=single-node
# mem_limit: 1g
# logging:
# driver: none
# healthcheck:
# test: [ "CMD-SHELL", "curl --silent --fail localhost:9200/_cluster/health || exit 1" ]
# interval: 30s
# timeout: 30s
# retries: 3
# networks:
# - wikonnect
backend:
build:
context: ./server/
dockerfile: Dockerfile
args:
NODE_ENV: ${NODE_ENV}
restart: "always"
env_file:
- .env
ports:
- "${SERVER_PORT}:${SERVER_PORT}"
volumes:
- backenddeps:/usr/src/app/node_modules
- ./server:/usr/src/app/
depends_on:
wikonnect-postgres:
condition: service_healthy
# wikonnect-elastic:
# condition: service_healthy
networks:
- wikonnect
frontend:
build:
context: ./frontend/
dockerfile: Dockerfile
restart: "always"
env_file: .env
ports:
- "${FRONTEND_PORT}:${FRONTEND_PORT}"
volumes:
- frontenddeps:/usr/src/app/node_modules
- ./frontend:/usr/src/app/
depends_on:
backend:
condition: service_started
networks:
- wikonnect
volumes:
frontenddeps:
name: wikonnectfrontenddeps
driver: local
backenddeps:
name: wikonnectbackenddeps
driver: local
# elasticsearch:
# name: wikonnect-elasticsearch
# driver: local
networks:
wikonnect:
name: wikonnect
driver: bridge