cv-analysis-service/Dockerfile
2023-02-27 08:57:28 +01:00

38 lines
1010 B
Docker

FROM python:3.8
RUN python -m venv /app/venv
ENV PATH="/app/venv/bin:$PATH"
RUN python -m pip install --upgrade pip
WORKDIR /app/service
COPY ./requirements.txt ./requirements.txt
RUN python3 -m pip install -r requirements.txt
COPY ./incl/pyinfra/requirements.txt ./incl/pyinfra/requirements.txt
RUN python -m pip install -r incl/pyinfra/requirements.txt
COPY ./incl/pdf2image/requirements.txt ./incl/pdf2image/requirements.txt
RUN python -m pip install -r incl/pdf2image/requirements.txt
COPY ./incl ./incl
RUN python3 -m pip install -e incl/pyinfra
RUN python3 -m pip install -e incl/pdf2image
COPY ./src ./src
COPY ./cv_analysis ./cv_analysis
COPY ./setup.py ./setup.py
# User for the process to run as
RUN groupadd --gid 1001 non-root \
&& useradd --uid 1001 --gid 1001 -m non-root
RUN python3 -m pip install -e .
COPY --chown=1001:1001 ./src/serve.py ./src/serve.py
RUN chown -R 1001:1001 ./cv_analysis ./cv_analysis
RUN chown -R 1001:1001 ./incl ./incl
CMD ["python3", "-u", "src/serve.py"]