I need to have ghostscript and ImageMagick available to do some PDF editting and OCR. I have got to the point that I use a Dockerfile but it seems that gcloud app deploy
would start from the beginning each time. Is there a way to speed it up by having the packages installed once?
Here's my Dockerfile:
ROM gcr.io/google-appengine/python
LABEL python_version=python3.6
RUN virtualenv --no-download /env -p python3.6
# Set virtualenv environment variables. This is equivalent to running
# source /env/bin/activate
ENV VIRTUAL_ENV /env
ENV PATH /env/bin:$PATH
ADD requirements.txt /app/
RUN pip install -r requirements.txt
ADD . /app/
RUN apt-get update
RUN apt-get install imagemagick -y
RUN apt-get install ghostscript
CMD exec gunicorn -b :$PORT main:app