Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save chrimaho/c25d5b4031d0f9eef5c99fe4cd27e78f to your computer and use it in GitHub Desktop.
Save chrimaho/c25d5b4031d0f9eef5c99fe4cd27e78f to your computer and use it in GitHub Desktop.
# Base image
FROM tiangolo/uvicorn-gunicorn-fastapi:python3.7
# Load requirements
COPY requirements.txt .
# Install dependencies
RUN pip3 install --upgrade pip
RUN pip3 install --no-cache-dir -r requirements.txt
RUN pip3 install --upgrade uvicorn[standard]
# Copy static files
COPY templates templates
COPY src src
# Change working directory
WORKDIR /app
# Set command line
CMD [ "uvicorn" \
, "main:app" \
, "--app-dir", "/src/api" \
, "--host", "0.0.0.0" \
, "--port", "8880" \
, "--root-path", "." \
, "--reload" \
, "--use-colors" \
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment