sistema_web/Docker/Dockerfile.public_dynamic

31 lines
816 B
Docker

FROM python:3-slim
# set a directory for the app
RUN groupadd app && useradd -m -g app app
# install dependencies
WORKDIR /srv
RUN pip3 install setuptools gunicorn
COPY public-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 public-dynamic /srv/webinterface
COPY static /srv/static
COPY templates/layout.html templates/home.html templates/objetivos.html /srv/webinterface/templates
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"]