-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (21 loc) · 919 Bytes
/
Dockerfile
File metadata and controls
29 lines (21 loc) · 919 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
FROM python:3.13-alpine AS poetry
RUN apk update && apk upgrade && \
apk add curl gcc python3-dev libc-dev build-base linux-headers && \
rm -rf /var/cache/apk
RUN curl https://install.python-poetry.org | python -
COPY pyproject.toml /opt/StorageLeaf/pyproject.toml
COPY poetry.lock /opt/StorageLeaf/poetry.lock
COPY src/ /opt/StorageLeaf/src
WORKDIR /opt/StorageLeaf
RUN /root/.local/bin/poetry install --no-root
RUN ln -s $($HOME/.local/share/pypoetry/venv/bin/poetry env info -p) /opt/StorageLeaf/venv
FROM python:3.13-alpine
RUN apk update && apk upgrade && \
rm -rf /var/cache/apk
COPY src/ /opt/StorageLeaf/src
COPY --from=poetry /opt/StorageLeaf/venv /opt/StorageLeaf/venv
RUN adduser -D StorageLeaf && chown -R StorageLeaf:StorageLeaf /opt/StorageLeaf
USER StorageLeaf
WORKDIR /opt/StorageLeaf/src
EXPOSE 10003
CMD [ "/opt/StorageLeaf/venv/bin/python", "/opt/StorageLeaf/src/StorageLeaf.py"]