github.com/benoitkugler/goacve@v0.0.0-20201217100549-151ce6e55dc8/weasyprint_docker/Dockerfile (about)

     1  #Grab the latest alpine image
     2  FROM alpine:latest
     3  
     4  # Install python and pip
     5  RUN apk add --no-cache --update python3 py3-pip bash
     6  ADD ./webapp/requirements.txt /tmp/requirements.txt
     7  
     8  # Install weasyprint dependencies
     9  RUN apk --update --upgrade add cairo pango gdk-pixbuf py3-cffi py3-pillow py-lxml font-noto ttf-freefont
    10  
    11  # Install dependencies
    12  RUN pip3 install --no-cache-dir -q -r /tmp/requirements.txt
    13  
    14  # Add our code
    15  ADD ./webapp /opt/webapp/
    16  WORKDIR /opt/webapp
    17  # RUN mkdir /root/.fonts
    18  # ADD ./fonts/* /root/.fonts/
    19  
    20  # Expose is NOT supported by Heroku
    21  # EXPOSE 5000 		
    22  
    23  # Run the image as a non-root user
    24  RUN adduser -D myuser
    25  USER myuser
    26  
    27  # Run the app.  CMD is required to run on Heroku
    28  # $PORT is set by Heroku			
    29  CMD gunicorn --bind 0.0.0.0:$PORT wsgi 
    30