-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
45 lines (42 loc) · 976 Bytes
/
docker-compose.yml
File metadata and controls
45 lines (42 loc) · 976 Bytes
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
version: '3'
services:
django:
build: .
restart: always
container_name: ${ENVIRONMENT}_django
env_file:
- .env
volumes:
# Useful in order to not give in the container a lot of useless files that we already wanted to ignore in the dockerignore
- ./YOUR_PROJECT:/home/django/YOUR_PROJECT
- ./apps:/home/django/apps
command: ["./script/wait_for_postgres.sh"]
depends_on:
- db
- redis
db:
image: postgres:10.5-alpine
restart: always
container_name: ${ENVIRONMENT}_db
env_file:
- .env
volumes:
- db:/var/lib/postgresql
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $$POSTGRES_USER"]
interval: 3s
timeout: 1s
retries: 5
redis:
image: redis:5.0.3-alpine
container_name: ${ENVIRONMENT}_redis
volumes:
- redis:/data
healthcheck:
test: "redis-cli ping"
interval: 3s
timeout: 1s
retries: 5
volumes:
db:
redis: