Skip to content

Instantly share code, notes, and snippets.

@starlightromero
Created July 19, 2021 22:56
Show Gist options
  • Save starlightromero/d1cf661f61ea521a4b9f42c4f4d57d01 to your computer and use it in GitHub Desktop.
Save starlightromero/d1cf661f61ea521a4b9f42c4f4d57d01 to your computer and use it in GitHub Desktop.
Python Dockerfile.alpine
FROM python:3.9-alpine as build
WORKDIR /usr/src/app
COPY requirements.txt .
RUN pip install --no-cache-dir --upgrade pip==21.1.2 && \
pip install --no-cache-dir -r requirements.txt
COPY . .
FROM python:3.9-alpine
WORKDIR /usr/src/app
COPY --from=build /usr/src/app .
EXPOSE 8080
CMD [ "flask", "run", "--host=0.0.0.0", "--port=8080" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment