FROM python:3-slim RUN apt-get update && apt-get -y install build-essential ghostscript && apt-get clean # set a directory for the app RUN groupadd app && useradd -m -g app app # install dependencies WORKDIR /srv RUN pip3 install setuptools gunicorn COPY private-dynamic/requirements.txt /srv/webinterface/requirements.txt RUN pip3 install --no-cache-dir -r webinterface/requirements.txt # copy all the files to the container COPY app.py /srv COPY font /srv/font COPY private-dynamic /srv/webinterface COPY models/__init__.py models/system.py models/gtfs_work.py models/gtfs_static.py /srv/webinterface/models RUN chown -R app:app /srv USER app # define the port number the container should expose EXPOSE 8000 # run the command ENTRYPOINT ["gunicorn"] CMD ["-b", "0.0.0.0:8000", "app:iapp"]