-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
65 lines (60 loc) · 1.51 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
# This is an Extension: https://github.com/compose-spec/compose-spec/blob/main/spec.md#extension
x-environment: &env
env_file:
- ./.env
services:
django:
container_name: django
build:
context: .
dockerfile: ./docker/web/Dockerfile
entrypoint: ./docker/web/start_server.sh
restart: always
volumes:
- ./:/app # Mount the current directory to /app within the container
ports:
- "8000:8000"
healthcheck:
test: [ "CMD", "curl", "--silent", "--fail", "http://127.0.0.1:8000/healthcheck/" ]
interval: 30s
timeout: 10s
retries: 3
start_period: 30s
depends_on:
redis:
condition: service_started
postgres:
condition: service_healthy
<<: *env # This is a YAML merge
celery:
container_name: celery
build:
context: .
dockerfile: ./docker/celery/Dockerfile
restart: always
volumes:
- ./:/app
depends_on:
django:
# Migrations need to be run before celery can start because of django-celery-results
condition: service_healthy
<<: *env
redis:
container_name: redis
image: redis:alpine
restart: always
postgres:
container_name: postgres
image: postgres:alpine
restart: always
volumes:
- db-vol:/var/lib/postgresql/data
healthcheck:
test: [ "CMD", "pg_isready", "-d", "${POSTGRES_DB}", "-U", "${POSTGRES_USER}" ]
interval: 30s
timeout: 15s
retries: 3
start_period: 30s
<<: *env
volumes:
db-vol: