-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Django static files from host directory to container. (#75)
Set file permissions explicitly when ./manage.py collectstatic runs.
- Loading branch information
1 parent
3d6a6b2
commit 56afeb8
Showing
5 changed files
with
18 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
#!/bin/bash | ||
docker-compose run thresher_api sh /home/thresher/docker/thresher_api/init_django.sh | ||
docker-compose run thresher_api sh /home/thresher/docker/thresher_api/init_users.sh | ||
# Must use 'exec' since ./manage.py collectstatic modifies the container | ||
docker-compose exec thresher_api sh /home/thresher/docker/thresher_api/init_django.sh | ||
# DB updates can use either 'run' or 'exec' | ||
docker-compose exec thresher_api sh /home/thresher/docker/thresher_api/init_users.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
#!/bin/bash | ||
docker-compose run thresher_api sh /home/thresher/docker/thresher_api/init_all.sh | ||
# Must use 'exec' since ./manage.py collectstatic modifies the container | ||
docker-compose exec thresher_api sh /home/thresher/docker/thresher_api/init_all.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
from django.contrib.staticfiles import storage | ||
|
||
# Configure the permissions used by ./manage.py collectstatic | ||
# See https://docs.djangoproject.com/en/1.10/ref/contrib/staticfiles/ | ||
class TTStaticFilesStorage(storage.StaticFilesStorage): | ||
def __init__(self, *args, **kwargs): | ||
kwargs['file_permissions_mode'] = 0o644 | ||
kwargs['directory_permissions_mode'] = 0o755 | ||
super(TTStaticFilesStorage, self).__init__(*args, **kwargs) |