-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.prod.yml
81 lines (73 loc) · 1.87 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
version: "3"
services:
server:
hostname: server
build:
context: ./server
dockerfile: Dockerfile.prod
ports:
- 8443:8443
container_name: poll_server
restart: always
depends_on:
- database
environment:
TZ: "Africa/Nairobi"
networks:
- polls_network
client:
hostname: client
build:
context: ./client
dockerfile: Dockerfile
ports:
- 80:80
- 443:443
depends_on:
- server
environment:
TZ: "Africa/Nairobi"
container_name: poll_client
networks:
- polls_network
redis:
hostname: redis
image: redis:alpine
hostname: redis
restart: always
volumes:
- ../data/redis:/data
entrypoint: redis-server --appendonly yes
ports:
- 6379:6379
environment:
TZ: "Africa/Nairobi"
networks:
- polls_network
database:
hostname: database
image: postgres:alpine
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
POSTGRES_DB: polls-db-prod
#PGDATA: /var/libs/postgresql/data
TZ: "Africa/Nairobi"
healthcheck:
test: ['CMD-SHELL', 'pg_is ready -U postgres']
interval: 10s
timeout: 5s
retries: 5
restart: always
depends_on:
- redis
volumes:
#- ../data/pg-data:/var/libs/postgresql/data/:rw
- ../data/pg-data:/var/libs/postgresql/data
ports:
- 5432:5432
networks:
- polls_network
networks:
polls_network:
driver: bridge