Skip to content

Commit

Permalink
move media directory to root
Browse files Browse the repository at this point in the history
  • Loading branch information
nicokant committed Dec 19, 2023
1 parent 5a57451 commit 5592705
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ tags
dump.rdb

### Project template
metadata_catalogue/media/

.pytest_cache/
.ipython/
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
2 changes: 1 addition & 1 deletion config/settings/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/"

Expand Down
4 changes: 3 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -163,6 +165,6 @@ services:
build:
context: ./nginx
volumes:
- ./metadata_catalogue/media:/media_files
- ./media:/media_files
ports:
- 8000:80
2 changes: 2 additions & 0 deletions media/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
2 changes: 2 additions & 0 deletions shared/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore

0 comments on commit 5592705

Please sign in to comment.