Repository navigation
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
61 lines (61 loc) · 1.57 KB
/
Copy pathdocker-compose.yml
File metadata and controls
61 lines (61 loc) · 1.57 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
services:
web:
build:
context: .
dockerfile: Dockerfile.dev
target: dev
args:
UV_SYNC_ARGS: '--all-groups'
ports:
- '${PORT:-8000}:${PORT:-8000}'
environment:
DJANGO_SETTINGS_MODULE: apps.guide.settings.dev
DATABASE_URL: postgres://guide@db/guide # pragma: allowlist secret
env_file:
- path: .env
required: false
volumes:
- .:/app
- staticfiles:/app/static
# Keeps node_modules (installed into the dev image, see Dockerfile.dev)
# from being shadowed by the bind mount above. Since Docker keeps this
# directory's contents separate from the host, run npm/Node commands
# consistently from inside the container (not from the host) so they
# see the same node_modules.
- node_modules:/app/node_modules
command:
- uv
- run
- python
- manage.py
- runserver
- '0.0.0.0:${PORT:-8000}'
init: true
depends_on:
db:
condition: service_healthy
db:
image: postgres:17
expose:
- 5432
environment:
# Location of DB data folder
PGDATA: /var/lib/postgresql/data/pgdata
# Defaults for createdb/dropdb/pg_restore etc.
PGDATABASE: guide
PGUSER: guide
# Values for initdb
POSTGRES_HOST_AUTH_METHOD: trust
POSTGRES_USER: guide
volumes:
- pgdata:/var/lib/postgresql/data
attach: false
healthcheck:
test: ['CMD-SHELL', 'pg_isready -U guide']
interval: 5s
timeout: 5s
retries: 5
volumes:
staticfiles:
node_modules:
pgdata: