-
Notifications
You must be signed in to change notification settings - Fork 21
/
Dockerfile
34 lines (25 loc) · 857 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
FROM deepset/haystack:base-cpu-v1.13.0 as base
FROM base AS python-deps
# Install pipenv and compilation dependencies
RUN pip install pipenv
RUN apt-get update && apt-get install -y --no-install-recommends gcc
# Install python dependencies in /.venv
COPY Pipfile .
COPY Pipfile.lock .
#RUN pipenv requirements > requirements.txt
#RUN pip install -r requirements.txt
RUN pipenv run pip install --upgrade setuptools
RUN pipenv install --system --deploy
FROM python-deps AS runtime
# Copy virtual env from python-deps stage
#COPY --from=python-deps /.venv /.venv
#ENV PATH="/.venv/bin:$PATH"
# Create and switch to a new user
RUN useradd --create-home appuser
WORKDIR /home/appuser
USER appuser
ENV TIKA_LOG_PATH=/home/appuser
# Install application into container
COPY . .
EXPOSE 8080
CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8080"]