-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathdocker-compose.prod.yml
64 lines (62 loc) · 2.04 KB
/
docker-compose.prod.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
services:
api-prod:
container_name: api-prod
image: "ponomarevandrey/livestreamer-backend_api-prod:latest"
# Uncomment 'build' to build the image for the first-time deployment (i.e.
# to upload to Docker Hub) or if you want to run prod env on local machine
# instead of VPS
build:
context: ./api
dockerfile: ./docker/Dockerfile
# Should match the stage name in Dockerfile
target: production
restart: always
init: true
tty: true
ports:
# Adding '127.0.0.1:' hides opened ports from Internet, 5000 is available
# only in internal network on host machine
- 127.0.0.1:5000:5000
env_file:
- ./api/docker/.api.common.env
- ./api/docker/.api.prod.env
- ./postgres/docker/.postgres.common.env
- ./postgres/docker/.postgres.prod.env
volumes:
# set the container timezone to the time zone of host machine
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
depends_on:
- postgres-prod
- redis-prod
postgres-prod:
container_name: postgres-prod
image: "ponomarevandrey/livestreamer-backend_postgres-prod:latest"
# Uncomment to build the image for the first-time deployment (i.e. to
# upload to Docker Hub) or if you want to run prod env on local machine
# instead of VPS
build:
context: ./postgres
dockerfile: ./docker/Dockerfile
target: production
restart: always
init: true
env_file:
- ./postgres/docker/.postgres.common.env
- ./postgres/docker/.postgres.prod.env
volumes:
- /var/backups/:/var/backups/
ports:
- 127.0.0.1:5432:5432
redis-prod:
image: "ponomarevandrey/livestreamer-backend_redis-prod:latest"
container_name: redis-prod
# Uncomment to build the image for the first-time deployment (i.e. to
# upload to Docker Hub) or if you want to run prod env on local machine
# instead of VPS
build:
context: ./redis
dockerfile: ./docker/Dockerfile
init: true
ports:
- 127.0.0.1:6379:6379