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

Use unbuffered stdout for containers #19

Merged
merged 1 commit into from
Jun 30, 2017
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
1 change: 1 addition & 0 deletions docker/Dockerfile-dev
Original file line number Diff line number Diff line change
@@ -46,4 +46,5 @@ WORKDIR /app
# added to PYTHONPATH though.
RUN cd / && pip install --no-cache /app
ENV PYTHONPATH /app
ENV PYTHONUNBUFFERED=1
CMD ["lando-api-dev"]
2 changes: 2 additions & 0 deletions docker/Dockerfile-prod
Original file line number Diff line number Diff line change
@@ -11,6 +11,8 @@ CMD ["/usr/local/bin/uwsgi"]

RUN addgroup -g 10001 app && adduser -D -u 10001 -G app -h /app app

ENV PYTHONUNBUFFERED=1
Copy link
Contributor

Choose a reason for hiding this comment

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

we don't need this in production. In production we will be using mozlog which doesn't have this problem. (And I'm unsure what this will do in production, do you think it is fine to have in prod??)

Copy link
Contributor

Choose a reason for hiding this comment

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

Nevermind, I see your comment at the top!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, in prod it's even more important to not lose output because of a buffer. You never know when there will be a message in a buffer somewhere that's critical to debugging a problem, and you'll spend days pulling your hair out trying to figure out why there is no error message before the crash. 😄 😢


# uWSGI configuration
ENV UWSGI_MODULE=landoapi.wsgi:app \
UWSGI_SOCKET=:9000 \