Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +13 -13
Dockerfile
CHANGED
@@ -1,4 +1,4 @@
|
|
1 |
-
FROM python:3.12-
|
2 |
|
3 |
ENV UV_COMPILE_BYTECODE=1 \
|
4 |
UV_NO_CACHE=1 \
|
@@ -9,8 +9,12 @@ ENV UV_COMPILE_BYTECODE=1 \
|
|
9 |
GRADIO_SERVER_NAME=0.0.0.0
|
10 |
|
11 |
# skipcq: DOK-DL3008
|
12 |
-
RUN
|
13 |
-
|
|
|
|
|
|
|
|
|
14 |
|
15 |
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
16 |
|
@@ -18,26 +22,22 @@ RUN uv tool install --quiet huggingface-hub[cli] && \
|
|
18 |
huggingface-cli download --quiet hexgrad/Kokoro-82M && \
|
19 |
uv tool uninstall --quiet huggingface-hub
|
20 |
|
21 |
-
WORKDIR /
|
22 |
|
23 |
RUN --mount=type=bind,source=uv.lock,target=uv.lock \
|
24 |
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
|
25 |
--mount=type=bind,source=.python-version,target=.python-version \
|
26 |
--mount=type=bind,source=README.md,target=README.md \
|
27 |
-
--mount=type=bind,source=src,target=/
|
28 |
-
apk update && \
|
29 |
-
apk add --no-cache build-base python3-dev linux-headers espeak-ng-dev gcompat && \
|
30 |
-
apk add --no-cache espeak-ng ffmpeg && \
|
31 |
uv export --no-hashes --no-editable --no-dev --quiet -o requirements.txt && \
|
32 |
-
uv pip install --system -r
|
33 |
-
rm -rf /var/cache/apk/*
|
34 |
|
35 |
-
RUN chown -R vocalizr:vocalizr /
|
36 |
|
37 |
-
COPY --chown=vocalizr:vocalizr . /
|
38 |
|
39 |
USER vocalizr
|
40 |
|
41 |
EXPOSE ${GRADIO_SERVER_PORT}
|
42 |
|
43 |
-
CMD ["python", "src/vocalizr"]
|
|
|
1 |
+
FROM python:3.12-slim-bookworm
|
2 |
|
3 |
ENV UV_COMPILE_BYTECODE=1 \
|
4 |
UV_NO_CACHE=1 \
|
|
|
9 |
GRADIO_SERVER_NAME=0.0.0.0
|
10 |
|
11 |
# skipcq: DOK-DL3008
|
12 |
+
RUN groupadd vocalizr && \
|
13 |
+
useradd -g vocalizr -s /bin/bash -d /app vocalizr && \
|
14 |
+
apt-get update -qq && \
|
15 |
+
apt-get install -qq -y --no-install-recommends espeak-ng ffmpeg && \
|
16 |
+
apt-get clean -qq && \
|
17 |
+
rm -rf /var/lib/apt/lists/*
|
18 |
|
19 |
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
|
20 |
|
|
|
22 |
huggingface-cli download --quiet hexgrad/Kokoro-82M && \
|
23 |
uv tool uninstall --quiet huggingface-hub
|
24 |
|
25 |
+
WORKDIR /app
|
26 |
|
27 |
RUN --mount=type=bind,source=uv.lock,target=uv.lock \
|
28 |
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
|
29 |
--mount=type=bind,source=.python-version,target=.python-version \
|
30 |
--mount=type=bind,source=README.md,target=README.md \
|
31 |
+
--mount=type=bind,source=src,target=/app/src \
|
|
|
|
|
|
|
32 |
uv export --no-hashes --no-editable --no-dev --quiet -o requirements.txt && \
|
33 |
+
uv pip install --system -r pyproject.toml
|
|
|
34 |
|
35 |
+
RUN chown -R vocalizr:vocalizr /app
|
36 |
|
37 |
+
COPY --chown=vocalizr:vocalizr . /app
|
38 |
|
39 |
USER vocalizr
|
40 |
|
41 |
EXPOSE ${GRADIO_SERVER_PORT}
|
42 |
|
43 |
+
CMD ["python", "src/vocalizr"]
|