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

[story/EDROP-14] #15

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from
Open

[story/EDROP-14] #15

wants to merge 2 commits into from

Conversation

jophals
Copy link

@jophals jophals commented Jan 10, 2025

implemented supervisor and gunicorn in docker container initialization

Guidelines for Pull Requests

If you haven't yet read our code review guidelines, please do so, You can find them here.

Please confirm the following by adding an x for each item (turn [ ] into [x]).

  • I have removed all code style changes that are not necessary (e.g. changing blanks across the whole file that don’t need to be changed, adding empty lines in parts other than your own code)
  • I am not making any changes to files that don’t have any effect (e.g. imports added that don’t need to be added)
  • I do not have any sysout statements in my code or commented out code that isn’t needed anymore
  • I am not reformatting any files in the wrong format or without cause.
  • I am not changing file encoding or line endings to something else than UTF-8, LF
  • My pull request does not show an insane amount of files being changed although my ticket only requires a few files being changed
  • I have added Javadoc/documentation where appropriate
  • I have added test cases where appropriate
  • I have explained any part of my code/implementation decisions that is not be self-explanatory

Please provide a brief description of your ticket

Add supervisor and gunicorn to docker setup
GitHub Issue Link

Are there any other pull requests that this one depends on?

Anything else the reviewer needs to know?

@jophals jophals requested a review from jdamerow January 10, 2025 00:11
@jophals jophals self-assigned this Jan 10, 2025
@@ -2,7 +2,7 @@ version: "3.9"

services:
db:
image: postgres
image: postgres:14
Copy link
Member

Choose a reason for hiding this comment

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

while we should have a postgres version here, let's use the latest (16 I believe)

Copy link
Member

Choose a reason for hiding this comment

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

let's create a separate docker compose file for production and leave this the way it was

Dockerfile-prod Outdated

COPY edrop-gunicorn.sh /edrop/edrop-gunicorn.sh

RUN ["chmod", "+x", "/edrop/edrop-gunicorn.sh"]
Copy link
Member

Choose a reason for hiding this comment

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

we want supervisor to manage gunicorn, so this should not be necessary. instead just make sure supervisor is running.

Dockerfile-prod Outdated

RUN ["chmod", "+x", "/edrop/edrop-gunicorn.sh"]

ENTRYPOINT ["./edrop-gunicorn.sh"]
Copy link
Member

Choose a reason for hiding this comment

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

neither should this

python -m pip install -r requirements.txt
python manage.py migrate
python manage.py collectstatic --noinput
service supervisor start
Copy link
Member

Choose a reason for hiding this comment

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

this should not be needed here (and would actually lead to an infinite loop of starting supervisor (or error out maybe), since this is the script that supervisor runs to start gunicorn.

--workers $NUM_WORKERS \
--bind=0.0.0.0:8000 \
--log-level=info \
--log-file=-
Copy link
Member

Choose a reason for hiding this comment

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

needs to log to files not stdout

@jdamerow jdamerow closed this Jan 10, 2025
…lementation, added log file to gunicorn exec, created second docker compose file, updated README, etc...
@jophals jophals reopened this Jan 10, 2025
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.

2 participants