-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
72 lines (66 loc) · 1.68 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
version: '3.7'
services:
web:
build:
context: .
dockerfile: docker/Dockerfile-web
command: python todo_everything/manage.py runserver 0.0.0.0:8000
volumes:
- ./todo_everything:/home/webapp/todo_everything
ports:
- "8000:8000"
env_file:
- ./docker/.env.dev
depends_on:
- postgres
environment:
- DATABASE_NAME=postgres
- DATABASE_USER=postgres
- DATABASE_PASS=postgres
- DATABASE_HOST=postgres
- DATABASE_PORT=5432
- ALLOWED_HOSTS=localhost
jobs:
build:
context: .
dockerfile: docker/Dockerfile-web
# IMPORTANT: Need this or else celery won't be able to figure out the Django
# app's paths and all the Django app's settings paths won't point to the
# right thing.
working_dir: /home/webapp/todo_everything
command: celery --app todo_everything worker -l info
volumes:
- ./todo_everything:/home/webapp/todo_everything
env_file:
- ./docker/.env.dev
depends_on:
- postgres
- rabbitmq
postgres:
image: postgres:16-alpine
restart: always
ports:
- "5432:5432"
volumes:
- ./postgres:/var/lib/postgresql/data
environment:
# Persist postgres data even with `down -v`
- PGDATA=/var/lib/postgresql/data
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
rabbitmq:
image: rabbitmq:3.12.6-management
ports:
- "5672:5672"
# Management UI port
- "15672:15672"
environment:
- RABBITMQ_DEFAULT_USER=guest
- RABBITMQ_DEFAULT_PASS=guest
redis:
image: redis:7.2-alpine
ports:
- "6379:6379"
volumes:
pgdata: