Skip to content
Snippets Groups Projects
Dockerfile 854 B
Newer Older
Luka's avatar
Luka committed

# set "app" as the working directory from which CMD, RUN, ADD references
WORKDIR /app

Arie Peterson's avatar
Arie Peterson committed
# First install apt packages, so we can cache this even if requirements.txt
# changes.
# hadolint ignore=DL3008
RUN apt-get update \
Arie Peterson's avatar
Arie Peterson committed
  && apt-get install --no-install-recommends -y gcc g++ libffi-dev libc6-dev \
  && apt-get clean \
Arie Peterson's avatar
Arie Peterson committed
  && rm -rf /var/lib/apt/lists/*

# Now copy the python dependencies specification.
COPY requirements.txt .

# Install python dependencies.
RUN pip install --no-cache-dir -r requirements.txt

# now copy all the files in this directory to /app
COPY . .
Luka's avatar
Luka committed

# Listen to port 80 at runtime
EXPOSE 5000

# Define our command to be run when launching the container
Mart van Santen's avatar
Mart van Santen committed
CMD ["gunicorn", "app:app", "-b", "0.0.0.0:5000", "--workers", "8", "--reload", "--capture-output", "--enable-stdio-inheritance", "--log-level", "DEBUG"]