-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
37 lines (24 loc) · 806 Bytes
/
Dockerfile
File metadata and controls
37 lines (24 loc) · 806 Bytes
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
FROM python:3.12-alpine3.20 AS builder
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
RUN apk update && apk upgrade --no-cache libcrypto3 libssl3
RUN apk add --no-cache alpine-sdk linux-headers
RUN pip install --no-cache-dir "poetry==1.8.5"
RUN python3 -m venv /opt/venv
COPY . .
RUN poetry build
ENV PATH="/opt/venv/bin:$PATH"
RUN pip install --no-cache-dir dist/aidial_log_parser-*.whl
FROM builder AS test
RUN poetry install --with test
RUN poetry run pytest ./tests
FROM python:3.12-alpine3.20
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
WORKDIR /
RUN adduser -u 1001 --disabled-password --gecos "" appuser
USER appuser
COPY --from=builder --chown=appuser /opt/venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"
ENTRYPOINT ["python", "-m", "aidial_log_parser.parse_logs"]
CMD []