-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
115 lines (112 loc) · 2.36 KB
/
docker-compose.yml
File metadata and controls
115 lines (112 loc) · 2.36 KB
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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
version: '3.4'
services:
#############################
## PostgreSQL
postgres:
container_name: instatasksdb
image: postgres:alpine
restart: always
hostname: postgres
volumes:
- pgdata:/var/lib/postgresql/data
# - docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d:z
env_file:
- docker.env
ports:
- 5432
networks:
- postgresnet
deploy:
mode: replicated
replicas: 3
logging:
driver: 'json-file'
options:
max-file: '5'
max-size: 10m
##################################
## Redis
redis:
hostname: redis
image: redis:alpine
restart: on-failure
env_file:
- docker.env
volumes:
# - ./redis_storage/data:/data
- ./redis_storage/config:/usr/local/etc/redis:ro
ports:
- 6379
networks:
- redisnet
deploy:
mode: replicated
replicas: 2
logging:
driver: 'json-file'
options:
max-file: '5'
max-size: 10m
command: >
sh -c "env redis-server
--loglevel $$REDIS_LOGLEVEL
--databases $$REDIS_DATABASES
--appendonly $$REDIS_APPENDONLY
--maxmemory $$REDIS_MAXMEM
--maxmemory-policy $$REDIS_POLICY
--requirepass $$REDIS_PASSWORD"
##############################
## WEB
web:
container_name: instatasks
image: djekxa/instatasks:v1
hostname: instatasks
restart: on-failure
build:
context: .
dockerfile: Dockerfile
networks:
- instatasksnet
- postgresnet
- redisnet
volumes:
- .:/go/src/instatasks:ro
ports:
- 80:80
deploy:
mode: replicated
replicas: 3
depends_on:
- postgres
- redis
logging:
driver: 'json-file'
options:
max-file: '5'
max-size: 10m
links:
- postgres
- redis
###############################
## NETWORKS
networks:
instatasksnet:
driver: bridge
# attachable: true
postgresnet:
driver: overlay
# attachable: true
redisnet:
driver: overlay
# attachable: true
##############################
## VOLUMES
volumes:
pgdata:
driver: local-persist
driver_opts:
mountpoint: /home/deploy/mnt/postgresql/pgdata
docker-entrypoint-initdb.d:
driver: local-persist
driver_opts:
mountpoint: /home/deploy/mnt/postgresql/docker-entrypoint-initdb.d