28 lines
600 B
Docker
28 lines
600 B
Docker
FROM python:3-slim
|
|
|
|
RUN apt-get update \
|
|
&& apt-get -y install libpq-dev gcc \
|
|
&& pip install psycopg2
|
|
|
|
# set a directory for the app
|
|
COPY apiweb/requeriments.txt /srv
|
|
|
|
# install dependencies
|
|
RUN pip3 install --no-cache-dir -r /srv/requeriments.txt
|
|
|
|
COPY web.py /srv
|
|
COPY static /srv/static
|
|
COPY apiweb /srv/apiweb
|
|
COPY utils /srv/utils
|
|
|
|
# define the port number the container should expose
|
|
RUN groupadd app && useradd -g app app
|
|
RUN chown -R app:app /srv
|
|
USER app
|
|
WORKDIR /srv
|
|
EXPOSE 8000
|
|
|
|
# run the command
|
|
ENTRYPOINT ["gunicorn"]
|
|
CMD ["--timeout", "600", "-b", "0.0.0.0:8000", "web:iapp"]
|