-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
70 lines (63 loc) · 1.77 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
services:
db:
image: postgres
restart: always
# postgres needs more shared memory, MOAR
shm_size: 128mb
ports:
- 127.0.0.1:5432:5432
volumes:
- database:/var/lib/postgresql/data
environment:
POSTGRES_PASSWORD: ${DB_PASSWORD}
web:
build: .
ports:
- 8000:8000
# yes, yes, I should use secret files instead, but not now
environment:
- SECRET_KEY=${SECRET_KEY}
- DB_PASSWORD=${DB_PASSWORD}
- DB_HOST=db
- DJANGO_SUPERUSER_PASSWORD=${DJANGO_SUPERUSER_PASSWORD}
depends_on:
- db
deploy:
restart_policy:
condition: on-failure
# restart cooldown, if project was resurrected and then died again
# wait for 10 seconds before restarting it
delay: 10s
develop:
watch:
# restart the container on changes to entrypoint script
- action: sync+restart
path: ./scripts/entrypoint_docker.sh
target: /app/scripts/entrypoint_docker.sh
# rebuild the image if uv.lock changes
- action: rebuild
path: ./uv.lock
# rebuild the image if Dockefile changes
# how tf this isn't the default?
- action: rebuild
path: ./Dockerfile
# same as above
- action: rebuild
path: ./docker-compose.yml
# runserver has hot-reload, so sync will do
#
# gunicorn has it too, if you configure it, but it doesn't seem to
# support hot-reloading for static files
- action: sync
path: .
target: /app
# exclude virtual environment, because it's platform-specific
ignore:
- .venv/
adminer:
image: adminer
restart: always
ports:
- 127.0.0.1:8080:8080
volumes:
database: