Skip to content

Commit

Permalink
Try to make media files accessible from outside the container
Browse files Browse the repository at this point in the history
  • Loading branch information
eduherminio committed Aug 6, 2023
1 parent 8dd7c07 commit cc99ad4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion OpenSite/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
TEMPLATE_PATH = os.path.join(PROJECT_PATH, 'Templates')

MEDIA_URL = '/Media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'mediafiles')
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')

INSTALLED_APPS = [
'OpenBench',
Expand Down
5 changes: 2 additions & 3 deletions docker-compose.prod.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,16 @@ services:
volumes:
- ./db:/home/app/web/db
- static_volume:/home/app/web/staticfiles
- media_volume:/home/app/web/mediafiles
- ./media:/home/app/web/media
nginx:
build: ./nginx
volumes:
- static_volume:/home/app/web/staticfiles
- media_volume:/home/app/web/mediafiles
- ./media:/home/app/web/media
ports:
- 1337:80
depends_on:
- web

volumes:
static_volume:
media_volume:
4 changes: 4 additions & 0 deletions media/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Ignore everything in this directory
*
# Except this file
!.gitignore

0 comments on commit cc99ad4

Please sign in to comment.