Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Serve static files at Django root #454

Merged
merged 2 commits into from
Apr 27, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ services:
volumes:
- ./src/backend:/usr/local/src/backend
- $HOME/.aws:/root/.aws:ro
- ./taui/assets:/usr/local/src/backend/static/assets
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- ./taui/assets:/usr/local/src/backend/static/assets
- ./taui/assets:/usr/local/src/backend/static/assets
- ./taui/index.html:/usr/local/src/backend/static/index.html

Unfortunately, copying index.html as a command didn't work for me; however, mounting it as its own volume did. I'm not sure whether this is best practice but it makes sense to me that this file could persist across Docker containers like the rest of the stuff in taui/assets.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm thinking I must have already had the index.html file in my /static folder after trying to mount from before, so it was able to work for me locally but not actually in practice. This way makes sense to me and works well, so just pushed that change!

- ./taui/index.html:/usr/local/src/backend/static/index.html
working_dir: /usr/local/src/backend
depends_on:
database:
Expand Down