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

bind the logs inside docker-compose.yml #101

Merged
merged 2 commits into from
Oct 26, 2023

Conversation

mourginakis
Copy link
Contributor

Fixes an issue where the logs could not be written to the logs/ directory in the docker container. I think the file path was interpreted wrong:

gunicorn -w 1 -b 0.0.0.0:80 --access-logfile=logs/gunicorn_access.log --error-logfile=logs/gunicorn_error.log -k eventlet node_monitor.__main__:app

Error: Error: 'logs/gunicorn_error.log' isn't writable [FileNotFoundError(2, 'No such file or directory')]

Docker containers are supposed to be stateless, so we had two options:

  1. Output all logs to stdout so they get picked up by docker directly.
  2. Bind the /app/logs directory in the container to the logs/ directory on the machine.

I opted for (2) because it allows us to keep our separate logfiles:

  • gunicorn_access.log
  • gunicorn_error.log
  • node_monitor.log

@mourginakis mourginakis merged commit daf8ee3 into main Oct 26, 2023
1 check passed
@louisevelayo louisevelayo deleted the hotfix/fix-docker-logs-file-not-found-issue branch October 31, 2023 16:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant