-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathDockerfile
36 lines (24 loc) · 970 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
35
36
ARG PY_VERSION=3.13.1
FROM python:${PY_VERSION}-slim-bookworm AS builder
ENV PATH=/root/.local/bin:$PATH
WORKDIR /tmp
COPY requirements.txt /tmp/
RUN pip install --user --no-cache-dir -r requirements.txt
COPY dist /tmp/dist/
RUN pip install --user --no-cache-dir --find-links /tmp/dist platform-registry-api
FROM python:${PY_VERSION}-slim-bookworm AS runtime
LABEL org.opencontainers.image.source="https://github.com/neuro-inc/platform-registry-api"
ARG SERVICE_NAME="platform-registry-api"
ARG SERVICE_UID=1001
ARG SERVICE_GID=1001
RUN addgroup --gid $SERVICE_GID $SERVICE_NAME && \
adduser --uid $SERVICE_UID --gid $SERVICE_GID \
--home /home/$SERVICE_NAME --shell /bin/false \
--disabled-password --gecos "" $SERVICE_NAME
COPY --from=builder /root/.local /home/$SERVICE_NAME/.local
WORKDIR /app
USER $SERVICE_NAME
ENV PATH=/home/$SERVICE_NAME/.local/bin:$PATH
ENV REGISTRY_API_PORT=8080
EXPOSE $REGISTRY_API_PORT
CMD ["platform-registry-api"]