Skip to content

Instantly share code, notes, and snippets.

@wawhal
Last active May 8, 2018 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wawhal/7b873c12e26365ba4ee6ff92be29e963 to your computer and use it in GitHub Desktop.
Save wawhal/7b873c12e26365ba4ee6ff92be29e963 to your computer and use it in GitHub Desktop.
# start with a base container with python installed
FROM python:3
# install required debian packages
# add any package that is required after `python-dev`, end the line with \
RUN apt-get update && apt-get install -y \
build-essential \
python-dev \
&& rm -rf /var/lib/apt/lists/*
# install requirements
COPY src/requirements.txt /tmp/requirements.txt
RUN pip3 install -r /tmp/requirements.txt
# set /app as working directory
WORKDIR /app
# copy current directory to /app
COPY . /app
# run the flask app with gunicorn
# port is configured through the gunicorn config file
# reloading is set to tru in the gunicorn config file
CMD ["gunicorn", "--config", "./conf/gunicorn_config.py", "src:app"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment