Created
June 24, 2019 05:25
-
-
Save saikishandasari/af17599fb3f079a65d3d0051385b494b to your computer and use it in GitHub Desktop.
Custom runtime to install pyodbc on Google App Engine
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Load the base image provided by Google | |
FROM gcr.io/google-appengine/python | |
# Install tdsodbc & unixodbc | |
RUN apt-get update | |
RUN apt-get install -y tdsodbc unixodbc-dev | |
RUN apt install unixodbc-bin -y | |
RUN apt-get clean -y | |
ADD odbcinst.ini /etc/odbcinst.ini | |
# Create a virtualenv for dependencies. This isolates these packages from | |
# system-level packages. | |
# Use -p python3 or -p python3.7 to select python version. Default is version 2. | |
RUN virtualenv /env -p python3.7 | |
# Setting these environment variables are the same as running | |
# source /env/bin/activate. | |
ENV VIRTUAL_ENV /env | |
ENV PATH /env/bin:$PATH | |
# Copy the application's requirements.txt and run pip to install all | |
# dependencies into the virtualenv. | |
ADD requirements.txt /app/requirements.txt | |
RUN pip install -r /app/requirements.txt | |
# Add the application source code. | |
ADD . /app | |
# Run a WSGI server to serve the application. gunicorn must be declared as | |
# a dependency in requirements.txt. | |
CMD gunicorn -b :$PORT main:app |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment