Created
May 31, 2019 19:37
-
-
Save cmabastar/382ef768ba8282b7de55849ccb14b6d3 to your computer and use it in GitHub Desktop.
Docker graceful shutdown for honcho and flask
This file contains hidden or 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
FROM python:latest | |
RUN mkdir -p /app | |
WORKDIR /app | |
RUN python -m venv venv | |
ENV VIRTUAL_ENV /venv | |
ENV PATH /venv/bin:$PATH | |
ADD requirements.txt /app/requirements.txt | |
# Add prod requirements | |
ADD requirements /app/requirements | |
RUN pip install -r /app/requirements.txt | |
# Fix for requests and urllib | |
RUN pip install --upgrade requests | |
RUN pip install honcho | |
ADD . /app/ | |
# Required in elastic beanstalk | |
EXPOSE 5000 | |
# Do it w/ quotation marks to forward kill signals properly | |
CMD ["honcho", "start", "-e", "/app/vars/env.deploy", "-f", "/app/Procfile"] |
This file contains hidden or 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
scheduler: flask db upgrade && flask rq scheduler -v | |
worker_a: flask rq worker -v | |
worker_b: flask rq worker -v | |
worker_c: flask rq worker -v |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment