diff --git a/.gitignore b/.gitignore index ab0fb66..d39304a 100644 --- a/.gitignore +++ b/.gitignore @@ -271,7 +271,6 @@ tags dump.rdb ### Project template -metadata_catalogue/media/ .pytest_cache/ .ipython/ diff --git a/Dockerfile b/Dockerfile index e1029e4..808bc60 100644 --- a/Dockerfile +++ b/Dockerfile @@ -48,6 +48,7 @@ FROM base as django COPY --from=production /app . COPY --from=translation /app/locale locale COPY --from=source /app . +RUN mkdir media COPY entrypoint.sh . ENTRYPOINT ["./entrypoint.sh"] diff --git a/config/settings/base.py b/config/settings/base.py index 7988f59..05305a2 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -174,7 +174,7 @@ # MEDIA # ------------------------------------------------------------------------------ # https://docs.djangoproject.com/en/dev/ref/settings/#media-root -MEDIA_ROOT = str(APPS_DIR / "media") +MEDIA_ROOT = str(BASE_DIR / "media") # https://docs.djangoproject.com/en/dev/ref/settings/#media-url MEDIA_URL = "/media/" diff --git a/docker-compose.yml b/docker-compose.yml index d5cd5f0..148af41 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -58,6 +58,8 @@ x-django-dev: &django-dev - ./config:/app/config - ./metadata_catalogue:/app/metadata_catalogue - ./locale:/app/locale + - ./media:/app/media + - ./shared:/app/shared command: python manage.py runserver 0.0.0.0:8000 #command: python -m pdb -c continue manage.py runserver 0.0.0.0:8000 --nothreading --noreload @@ -163,6 +165,6 @@ services: build: context: ./nginx volumes: - - ./metadata_catalogue/media:/media_files + - ./media:/media_files ports: - 8000:80 diff --git a/media/.gitignore b/media/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/media/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore diff --git a/shared/.gitignore b/shared/.gitignore new file mode 100644 index 0000000..d6b7ef3 --- /dev/null +++ b/shared/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore