-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
29 lines (25 loc) · 1.1 KB
/
Dockerfile
File metadata and controls
29 lines (25 loc) · 1.1 KB
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 build
ARG MRMAT_VERSION="0.0.0.dev0"
ARG GIT_SHA=""
ARG WHEEL=""
ADD "$WHEEL" /
RUN pip install --user /mrmat_python_api_fastapi-*.whl
FROM python:3.13-alpine
ARG MRMAT_VERSION="0.0.0.dev0"
ARG GIT_SHA=""
LABEL org.opencontainers.image.title="MrMat :: Python API :: FastAPI"
LABEL org.opencontainers.image.description="A demonstration of common API interactions using Python's FastAPI"
LABEL org.opencontainers.image.authors="MrMat"
LABEL org.opencontainers.image.vendor="The MrMat Organisation"
LABEL org.opencontainers.image.licenses="MIT"
LABEL org.opencontainers.image.version="$MRMAT_VERSION"
LABEL org.opencontainers.image.revision="$GIT_SHA"
LABEL org.opencontainers.image.source="https://github.com/MrMatAP/mrmat-python-api-fastapi"
RUN addgroup -g 1000 app && \
adduser -g 'App User' -u 1000 -G app -D app
COPY --from=build /root/.local /home/app/.local
RUN chown -R 1000:1000 /home/app/.local
USER app:app
EXPOSE 8000
CMD ["/home/app/.local/bin/opentelemetry-instrument", \
"/home/app/.local/bin/uvicorn", "--host", "0.0.0.0", "--port", "8000", "mrmat_python_api_fastapi.app:app"]