Skip to content

Instantly share code, notes, and snippets.

@dineshsonachalam
Created January 15, 2019 16:22
Show Gist options
  • Select an option

  • Save dineshsonachalam/80ed0a857cc584e628f4ecf370a9017e to your computer and use it in GitHub Desktop.

Select an option

Save dineshsonachalam/80ed0a857cc584e628f4ecf370a9017e to your computer and use it in GitHub Desktop.
# Here we are creating an image for python alphine image.(https://hub.docker.com/r/library/python/)
FROM python:3
# Copying the requirements.txt first to leverage Docker cache
COPY ./requirements.txt /app/requirements.txt
# WORKDIR is nothing but current directory (cd app)
WORKDIR /app
# Install the requirements in the current directory.
RUN pip install -r requirements.txt
# Copying the entire application to the docker container in the app directory.
COPY . /app
# Setting environmental path to app directory. path environment variables tells shell,
# which directories to search for executable files.
ENV PATH /app:$PATH
# It executes the command python app.py in the app directory.
# start gunicorn
CMD ["gunicorn","--config","/app/gunicorn_config.py","app:app"]
EXPOSE 8005
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment