Skip to content

Commit 6140828

Browse files
committed
Use docker compose watch mode during development
1 parent c0a2d18 commit 6140828

File tree

2 files changed

+12
-6
lines changed

2 files changed

+12
-6
lines changed

adit_radis_shared/cli/commands.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def compose_up(profile: list[str], extra_args: list[str], **kwargs):
3131
"Check ENVIRONMENT setting in .env file."
3232
)
3333

34-
cmd = f"{helper.build_compose_cmd(profile)} up --detach"
34+
cmd = f"{helper.build_compose_cmd(profile)} up --watch"
3535
if extra_args:
3636
cmd += " " + " ".join(extra_args)
3737

docker-compose.dev.yml

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
11
x-app: &default-app
22
image: example_project_dev:latest
3-
volumes:
4-
- .:/app
5-
- /app/.venv
3+
build:
4+
target: development
65
environment:
76
DJANGO_INTERNAL_IPS: ${DJANGO_INTERNAL_IPS:?}
87
DJANGO_SETTINGS_MODULE: example_project.settings.development
98
FORCE_DEBUG_TOOLBAR: ${FORCE_DEBUG_TOOLBAR:-true}
109
REMOTE_DEBUGGING_ENABLED: ${REMOTE_DEBUGGING_ENABLED:-false}
1110
REMOTE_DEBUGGING_PORT: ${REMOTE_DEBUGGING_PORT:-5678}
11+
develop:
12+
watch:
13+
- action: sync
14+
path: .
15+
target: /app
16+
ignore:
17+
- .venv/
18+
- action: rebuild
19+
path: ./pyproject.toml
1220

1321
services:
1422
init:
@@ -17,8 +25,6 @@ services:
1725

1826
web:
1927
<<: *default-app
20-
build:
21-
target: development
2228
pull_policy: build
2329
ports:
2430
- ${WEB_DEV_PORT:-8000}:8000

0 commit comments

Comments
 (0)