Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
69 lines (65 loc) · 1.87 KB
/
Copy pathdocker-compose.yml
File metadata and controls
69 lines (65 loc) · 1.87 KB
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
services:
postgres:
image: postgres:15.3-bullseye
ports:
- "5433:5432"
environment:
POSTGRES_USER: pythondotorg
POSTGRES_PASSWORD: pythondotorg
POSTGRES_DB: pythondotorg
POSTGRES_HOST_AUTH_METHOD: trust # never do this in production!
healthcheck:
test: ["CMD", "pg_isready", "-U", "pythondotorg", "-d", "pythondotorg"]
interval: 1s
redis:
image: redis:7-bullseye
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli","ping"]
interval: 1s
mailpit:
image: axllent/mailpit:v1.27
ports:
- "8025:8025"
web:
build:
context: .
dockerfile: docker/Dockerfile
image: pythondotorg:docker-compose
command: uv run python manage.py runserver 0.0.0.0:8000
volumes:
- .:/code
ports:
- "8000:8000"
environment:
DATABASE_URL: postgresql://pythondotorg:pythondotorg@postgres:5432/pythondotorg
DJANGO_SETTINGS_MODULE: pydotorg.settings.local
EMAIL_BACKEND: django.core.mail.backends.smtp.EmailBackend
EMAIL_HOST: mailpit
EMAIL_PORT: 1025
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
mailpit:
condition: service_started
worker:
image: pythondotorg:docker-compose
command: uv run celery -A pydotorg worker -B -l INFO --scheduler django_celery_beat.schedulers:DatabaseScheduler
volumes:
- .:/code
environment:
DATABASE_URL: postgresql://pythondotorg:pythondotorg@postgres:5432/pythondotorg
DJANGO_SETTINGS_MODULE: pydotorg.settings.local
EMAIL_BACKEND: django.core.mail.backends.smtp.EmailBackend
EMAIL_HOST: mailpit
EMAIL_PORT: 1025
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
mailpit:
condition: service_started