Skip to content

Instantly share code, notes, and snippets.

@simonw
Created October 29, 2018 20:52
Show Gist options
  • Save simonw/0ea285e3347b1d06ec5abc1391887739 to your computer and use it in GitHub Desktop.
Save simonw/0ea285e3347b1d06ec5abc1391887739 to your computer and use it in GitHub Desktop.
Lightweight Dockerfile for running a Python 3 webapp under the Zeit 100MB limit
FROM alpine:edge
RUN apk add --update \
python3 \
python3-dev \
build-base \
&& python3 -m ensurepip \
&& rm -r /usr/lib/python*/ensurepip \
&& pip3 install --upgrade pip setuptools \
&& pip3 install starlette uvicorn \
&& rm -rf /var/cache/apk/*
ADD app.py app.py
EXPOSE 8009
# Start the server
CMD ["python3", "app.py"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment