-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile
27 lines (21 loc) · 876 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
FROM python:3.10.7-bullseye as build
RUN mkdir -p /builddir
WORKDIR /builddir
COPY ./ ./
RUN pip install .[buildtest37_onward]
RUN hatchling build --clean
FROM python:3.10.7-slim-bullseye
ARG VERSION
LABEL name="jsonparse" \
maintainer="[email protected]" \
version=${VERSION} \
summary="Search through JSON data key:values" \
description="ctrl-f for JSON. A simple JSON parsing library. Extract what's needed from key:value pairs." \
url="https://github.com/ctomkow/jsonparse"
RUN useradd --uid 1000 --create-home --shell /bin/bash nonroot
USER nonroot
ENV PATH "$PATH:/home/nonroot/.local/bin"
WORKDIR /home/nonroot
COPY --from=build /builddir/dist/jsonparse-${VERSION}-py3-none-any.whl ./
RUN pip install --user jsonparse-${VERSION}-py3-none-any.whl[webapi]
CMD ["sh", "-c", "exec gunicorn -b 0.0.0.0:${PORT:-8000} jsonparse.webapi:app"]