MH0386 commited on
Commit
9be293d
·
verified ·
1 Parent(s): bccf802

Upload folder using huggingface_hub

Browse files
Files changed (1) hide show
  1. Dockerfile +16 -32
Dockerfile CHANGED
@@ -1,47 +1,31 @@
1
- FROM python:3.13@sha256:4ea77121eab13d9e71f2783d7505f5655b25bb7b2c263e8020aae3b555dbc0b2 AS builder
2
 
3
- SHELL ["/bin/bash", "-c"]
 
4
 
5
- ENV UV_LINK_MODE=copy \
6
- UV_COMPILE_BYTECODE=1 \
7
- UV_PYTHON_DOWNLOADS=0
8
 
9
- COPY --from=ghcr.io/astral-sh/uv:latest@sha256:9ac8566d708f42bae522b050004f75ebc7c344bc726d6d4e70f1d308b18c4471 \
10
- /uv /uvx /bin/
11
-
12
- WORKDIR /app
13
 
14
  RUN --mount=type=cache,target=/root/.cache/uv \
15
- --mount=type=bind,source=uv.lock,target=uv.lock \
16
- --mount=type=bind,source=pyproject.toml,target=pyproject.toml \
17
- --mount=type=bind,source=README.md,target=README.md \
18
- uv sync --no-install-project --no-dev --locked --no-editable
19
-
20
- COPY . /app
21
-
22
- RUN --mount=type=cache,target=/root/.cache/uv \
23
- uv sync --no-dev --locked --no-editable
24
-
25
- FROM python:3.13-slim@sha256:4c2cf9917bd1cbacc5e9b07320025bdb7cdf2df7b0ceaccb55e9dd7e30987419 AS production
26
 
27
- SHELL ["/bin/bash", "-c"]
28
 
29
  ENV GRADIO_SERVER_PORT=7860 \
30
- GRADIO_SERVER_NAME=0.0.0.0
 
31
 
32
- RUN groupadd app && \
33
- useradd -m -g app -s /bin/bash app && \
34
- apt-get update > /dev/null && \
35
- apt-get install -y --no-install-recommends curl > /dev/null && \
36
- apt-get clean > /dev/null && \
37
- rm -rf /var/lib/apt/lists/*
38
 
39
- WORKDIR /home/app
40
 
41
- COPY --from=builder --chown=app:app --chmod=555 /app/.venv /app/.venv
42
 
43
- USER app
44
 
45
  EXPOSE ${GRADIO_SERVER_PORT}
46
 
47
- CMD ["/app/.venv/bin/chattr"]
 
1
+ FROM cgr.dev/chainguard/wolfi-base:latest@sha256:3a4709d9dfc2cf8f1d78ee8788d7b9ab907778a8be89543e961a2c29aa046529 AS builder
2
 
3
+ COPY --from=ghcr.io/astral-sh/uv:latest@sha256:40775a79214294fb51d097c9117592f193bcfdfc634f4daa0e169ee965b10ef0 \
4
+ /uv /uvx /usr/bin/
5
 
6
+ # skipcq: DOK-DL3018
7
+ RUN apk add --no-cache build-base git
 
8
 
9
+ USER nonroot
 
 
 
10
 
11
  RUN --mount=type=cache,target=/root/.cache/uv \
12
+ uv tool install git+https://github.com/AlphaSphereDotAI/chattr
 
 
 
 
 
 
 
 
 
 
13
 
14
+ FROM cgr.dev/chainguard/wolfi-base:latest@sha256:3a4709d9dfc2cf8f1d78ee8788d7b9ab907778a8be89543e961a2c29aa046529 AS production
15
 
16
  ENV GRADIO_SERVER_PORT=7860 \
17
+ GRADIO_SERVER_NAME=0.0.0.0 \
18
+ PATH=/home/nonroot/.local/bin:$PATH
19
 
20
+ # skipcq: DOK-DL3018
21
+ RUN apk add --no-cache curl libstdc++
 
 
 
 
22
 
23
+ USER nonroot
24
 
25
+ WORKDIR /home/nonroot
26
 
27
+ COPY --from=builder --chown=nonroot:nonroot --chmod=555 /home/nonroot/.local/ /home/nonroot/.local/
28
 
29
  EXPOSE ${GRADIO_SERVER_PORT}
30
 
31
+ CMD ["chattr"]