29 lines
676 B
Docker
29 lines
676 B
Docker
|
FROM ubuntu:22.04
|
||
|
#FROM debian:buster-slim
|
||
|
#FROM python:3
|
||
|
|
||
|
RUN apt-get update -y
|
||
|
RUN apt-get install -y python3-pip python3-bs4
|
||
|
|
||
|
# set a directory for the app
|
||
|
RUN groupadd app && useradd -m -g app app
|
||
|
|
||
|
# copy all the files to the container
|
||
|
#RUN git clone https://dev.ilab.cl/public/pythonweb.git /srv
|
||
|
COPY app.py /srv
|
||
|
COPY webinterface /srv/webinterface
|
||
|
RUN chown -R app:app /srv
|
||
|
|
||
|
|
||
|
# install dependencies
|
||
|
WORKDIR /srv
|
||
|
RUN pip3 install setuptools gunicorn
|
||
|
RUN pip3 install --no-cache-dir -r webinterface/requirements.txt
|
||
|
|
||
|
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"]
|