Skip to content

Commit b3c8428

Browse files
committed
Named volume with path from environment variable
1 parent e90ea8c commit b3c8428

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

docker-compose-prod.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,3 +30,8 @@ services:
3030

3131
volumes:
3232
media:
33+
driver: local
34+
driver_opts:
35+
type: none
36+
o: bind
37+
device: $MEDIA_ROOT

go_capture/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
126126

127127
MEDIA_URL = "media/"
128-
MEDIA_ROOT = BASE_DIR / "media"
128+
MEDIA_ROOT = env.path("MEDIA_ROOT")
129129
MEDIA_ROOT.mkdir(exist_ok=True)
130130

131131
IMAGES_DIR = MEDIA_ROOT / "images"

0 commit comments

Comments
 (0)