-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
128 lines (120 loc) · 2.67 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
version: "3.9"
# docker-compose --env-file ./docker.env up -d --build
# docker-compose --env-file ./docker.env down
services:
app:
build:
context: ./app
dockerfile: dockerfile
image: master-image
restart: always
container_name: asset-app
expose:
- 80
networks:
- asset-network
volumes:
- upload_data:/home/app/web/uploads
- static_data:/home/app/web/static
env_file:
- docker.env
depends_on:
- postgres
- redis
environment:
REDIS_HOST: redis
REDIS_PORT: 6379
DOCKER: 'true'
DATABASE_URL: 'postgres://${DB_USER}:${DB_PASSWORD}@postgres/${DB_NAME}'
pgadmin:
build:
context: ./pgadmin
dockerfile: dockerfile
container_name: asset-pgadmin
restart: always
expose:
- 80
environment:
PGADMIN_DEFAULT_EMAIL: ${PGADMIN_DEFAULT_EMAIL}
PGADMIN_DEFAULT_PASSWORD: ${PGADMIN_DEFAULT_PASSWORD}
volumes:
- pgadmin_data:/var/lib/pgadmin
networks:
- asset-network
depends_on:
- postgres
postgres:
image: postgis/postgis:12-master
container_name: asset-postgres
restart: always
networks:
- asset-network
expose:
- 5432
volumes:
- postgres_data:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
POSTGRES_DB: ${DB_NAME}
POSTGRES_USER: postgres
redis:
restart: always
image: redis:latest
container_name: asset-redis-server
command: redis-server --save 60 1 --loglevel warning
privileged: true
expose:
- 6379
networks:
- asset-network
volumes:
- redis_data:/data
env_file:
- docker.env
environment:
- ALLOW_EMPTY_PASSWORD=yes
worker:
image: master-image
container_name: asset-redis-worker
depends_on:
- redis
- app
command: python3 -m rds.worker # rq worker --name worker --url redis://redis:6379/0
networks:
- asset-network
env_file:
- docker.env
environment:
REDIS_HOST: redis
REDIS_PORT: 6379
DOCKER: 'true'
DATABASE_URL: 'postgres://${DB_USER}:${DB_PASSWORD}@postgres/${DB_NAME}'
volumes_from:
- app:rw
restart: always
nginx:
build:
context: ./nginx
dockerfile: dockerfile
restart: always
ports:
- ${WEB_PORT}:2000
- ${REDIS_PORT}:2001
- ${PGADMIN_PORT}:2002
- ${POSTGRES_PORT}:2003
networks:
- asset-network
depends_on:
- app
volumes_from:
- app:rw
volumes:
static_data:
upload_data:
pgadmin_data:
postgres_data:
redis_data:
driver: local
networks:
asset-network:
driver: bridge