-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yaml
52 lines (50 loc) · 1.01 KB
/
docker-compose.yaml
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
services:
db:
image: postgres:14.1-alpine
restart: always
environment:
- POSTGRES_DB=blogdb
- POSTGRES_USER=myuser
- POSTGRES_PASSWORD=mypassword
ports:
- '5432:5432'
volumes:
- ./pgdata:/var/lib/postgresql/data
- ./db/init.sql:/docker-entrypoint-initdb.d/create_tables.sql
api:
container_name: app
build:
context: ./
dockerfile: Dockerfile.django
command: python manage.py runserver 0.0.0.0:8000
ports:
- '8000:8000'
environment:
DB_HOST: db
DB_PORT: 5432
DB_USER: myuser
DB_PASSWORD: mypassword
DB_NAME: blogdb
depends_on:
- db
- redis
volumes:
- .:/app
celery:
build:
context: .
dockerfile: Dockerfile.celery
command: celery -A BlogApp worker --loglevel=info
depends_on:
- db
- redis
volumes:
- .:/app
redis:
image: redis:latest
restart: always
ports:
- '6379:6379'
volumes:
db_data:
driver: local