Skip to content

Commit a9f5fc6

Browse files
authored
Use docker compose watch for development (#119)
Adding a development section with watch
1 parent 30ecbb7 commit a9f5fc6

File tree

2 files changed

+26
-8
lines changed

2 files changed

+26
-8
lines changed

dev-postgres/docker-compose.yml

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,27 @@ services:
44
web:
55
build:
66
pull: true
7-
context: ${WGER_CODEPATH}
7+
context: ${WGER_CODEPATH:?set the absolute path to the wger backend code in the .env file or env variable}
88
dockerfile: ./extras/docker/development/Dockerfile
9+
develop:
10+
watch:
11+
- action: sync
12+
path: ${WGER_CODEPATH}/wger
13+
target: /home/wger/src
14+
- action: rebuild
15+
path: ${WGER_CODEPATH}/requirements.txt
16+
- action: rebuild
17+
path: ${WGER_CODEPATH}/requirements_dev.txt
918
env_file:
1019
- ../config/prod.env
1120
- ../config/dev.env
1221
volumes:
1322
- type: bind
14-
source: ${WGER_CODEPATH:?set the absolute path to the wger backend code in the .env file or env variable}
23+
source: ${WGER_CODEPATH}
1524
target: /home/wger/src
1625
ports:
1726
- "8000:8000"
18-
# We use something here that never ends. The server is started manually
27+
1928
command: tail -f /dev/null
2029

2130
cache:
@@ -37,7 +46,7 @@ services:
3746
- POSTGRES_PASSWORD=wger
3847
- POSTGRES_DB=wger
3948
volumes:
40-
- postgres-data:/var/lib/postgresql/data/
49+
- postgres-data-dev:/var/lib/postgresql/data/
4150
ports:
4251
- "5432:5432"
4352
expose:
@@ -51,4 +60,4 @@ services:
5160
restart: unless-stopped
5261

5362
volumes:
54-
postgres-data:
63+
postgres-data-dev:

dev/docker-compose.yml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,28 @@ services:
44
web:
55
build:
66
pull: true
7-
context: ${WGER_CODEPATH}
7+
context: ${WGER_CODEPATH:?set the absolute path to the wger backend code in the .env file or env variable}
88
dockerfile: ./extras/docker/development/Dockerfile
9+
develop:
10+
watch:
11+
- action: sync
12+
path: ${WGER_CODEPATH}/wger
13+
target: /home/wger/src
14+
- action: rebuild
15+
path: ${WGER_CODEPATH}/requirements.txt
16+
- action: rebuild
17+
path: ${WGER_CODEPATH}/requirements_dev.txt
918
env_file:
1019
- ../config/prod.env
1120
- ../config/dev.env
1221
- ../config/dev-sqlite.env
1322
volumes:
1423
- type: bind
15-
source: ${WGER_CODEPATH:?set the absolute path to the wger backend code in the .env file or env variable}
24+
source: ${WGER_CODEPATH}
1625
target: /home/wger/src
1726
ports:
1827
- "8000:8000"
19-
# We use something here that never ends. The server is started manually
28+
2029
command: tail -f /dev/null
2130

2231
cache:

0 commit comments

Comments
 (0)