mirror of
https://github.com/dockersamples/example-voting-app.git
synced 2026-05-17 06:56:34 +00:00
24 lines
735 B
Docker
24 lines
735 B
Docker
# Using official python runtime base image
|
|
FROM python:3.11-slim
|
|
|
|
# add curl for healthcheck
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends curl && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
# Set the application directory
|
|
WORKDIR /usr/local/app
|
|
|
|
# Install our requirements.txt
|
|
COPY requirements.txt ./requirements.txt
|
|
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
# Copy our code from the current folder to the working directory inside the container
|
|
COPY . .
|
|
|
|
# Make port 80 available for links and/or publish
|
|
EXPOSE 80
|
|
|
|
# Define our command to be run when launching the container
|
|
CMD ["gunicorn", "app:app", "-b", "0.0.0.0:80", "--log-file", "-", "--access-logfile", "-", "--workers", "4", "--keep-alive", "0"]
|