Skip to content

Instantly share code, notes, and snippets.

@grant
Created November 19, 2019 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save grant/ad4771df380fa0efe7f345e2e79cfad9 to your computer and use it in GitHub Desktop.
Save grant/ad4771df380fa0efe7f345e2e79cfad9 to your computer and use it in GitHub Desktop.
YouTube API on Cloud Run Dockerfile
# Use the official lightweight Python image.
# https://hub.docker.com/_/python
FROM python:3.7-slim
# Copy local code to the container image.
ENV APP_HOME /app
WORKDIR $APP_HOME
COPY . ./
# Install production dependencies.
RUN pip install Flask gunicorn python-dotenv google-api-python-client google-auth-oauthlib google-auth-httplib2
# Run the web service on container startup. Here we use the gunicorn
# webserver, with one worker process and 8 threads.
# For environments with multiple CPU cores, increase the number of workers
# to be equal to the cores available.
CMD exec gunicorn --bind :$PORT --workers 1 --threads 8 app:app
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment