-
Notifications
You must be signed in to change notification settings - Fork 3
/
Dockerfile
44 lines (31 loc) · 1.24 KB
/
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
35
36
37
38
39
40
41
42
43
44
FROM ubuntu:23.10 as builder
# python3.11 is used in ubuntu:23.10 (https://packages.ubuntu.com/jammy/python3)
RUN apt-get update && \
apt-get install -y \
python3 \
python3-pip \
python3-poetry
WORKDIR /app
# Install split into two steps (the dependencies and the sources)
# in order to leverage the Docker caching
COPY pyproject.toml poetry.lock poetry.toml ./
RUN poetry install --no-interaction --no-ansi --no-cache --no-root --no-directory --only main
COPY . .
RUN poetry install --no-interaction --no-ansi --no-cache --only main
FROM ubuntu:23.10 as server
# python3.11 is used in ubuntu:23.10
RUN apt-get update && \
apt-get install -y python3 adduser
WORKDIR /app
# Copy the sources and virtual env. No poetry.
RUN adduser -u 1001 --disabled-password --gecos "" appuser
COPY --chown=appuser --from=builder /app .
COPY ./scripts/docker_entrypoint.sh /docker_entrypoint.sh
RUN chmod +x /docker_entrypoint.sh
ENV LOG_LEVEL=INFO
EXPOSE 5000
USER appuser
ENTRYPOINT ["/docker_entrypoint.sh"]
HEALTHCHECK --interval=10s --timeout=5s --start-period=30s --retries=6 \
CMD wget --no-verbose --tries=1 --spider http://localhost:5000/health || exit 1
CMD ["uvicorn", "aidial_adapter_vertexai.app:app", "--host", "0.0.0.0", "--port", "5000"]