-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
81 lines (74 loc) · 1.63 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
# production
version: "3"
x-common-variables: &common-variables
DB_USERNAME: $DB_USERNAME
DB_PASSWORD: $DB_PASSWORD
DB_NAME: $DB_NAME
DB_PORT: $DB_PORT
DB_DOCKER_SERVICE_NAME: $DB_DOCKER_SERVICE_NAME
services:
frontend:
container_name: hsl-frontend
build:
context: ./client
dockerfile: Dockerfile
restart: unless-stopped
depends_on:
- backend
networks:
- my-network
stdin_open: true
backend:
container_name: hsl-backend
# target is used to build a specific stage of ./server/Dockerfile
build:
context: ./server
dockerfile: Dockerfile
target: production
restart: unless-stopped
environment:
NODE_ENV: production
DB_USERNAME: $DB_USERNAME
DB_PASSWORD: $DB_PASSWORD
DB_NAME: $DB_NAME
DB_PORT: $DB_PORT
DB_DOCKER_SERVICE_NAME: $DB_DOCKER_SERVICE_NAME
ports:
- "8000:8000"
depends_on:
- postgres
networks:
- my-network
postgres:
image: postgres:latest
container_name: hsl-postgres
restart: always
environment:
<<: *common-variables
POSTGRES_DB: $DB_NAME
POSTGRES_USER: $DB_USERNAME
POSTGRES_PASSWORD: $DB_PASSWORD
ports:
- "5432:5432"
volumes:
- hsldata:/var/lib/postgresql/data
networks:
- my-network
nginx:
container_name: hsl-nginx
build:
context: ./nginx
dockerfile: Dockerfile
depends_on:
- frontend
- backend
restart: always
# The app is working in the localhost:8008.
ports:
- "8008:80"
networks:
- my-network
volumes:
hsldata:
networks:
my-network: