Vocalizr / Dockerfile
MH0386's picture
Update Dockerfile
ec2ef55 verified
raw
history blame
1.06 kB
FROM python:3.12-slim-bookworm
# Enable bytecode compilation, Copy from the cache instead of linking since it's a mounted volume
ENV UV_COMPILE_BYTECODE=1 \
UV_NO_CACHE=1 \
UV_SYSTEM_PYTHON=1 \
GRADIO_SERVER_PORT=8080
RUN groupadd vocalizr && \
useradd --gid vocalizr --shell /bin/bash --create-home vocalizr
# # skipcq: DOK-DL3008
# RUN apt-get update && \
# apt-get install -qq -y --no-install-recommends espeak-ng && \
# apt-get clean && \
# rm -rf /var/lib/apt/lists/*
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
WORKDIR /home/vocalizr/app
RUN --mount=type=bind,source=uv.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
--mount=type=bind,source=.python-version,target=.python-version \
uv export --no-hashes --no-editable --no-dev --quiet -o requirements.txt; \
uv pip install --system -r requirements.txt
COPY --chown=vocalizr:vocalizr . /home/vocalizr/app/
USER vocalizr
EXPOSE ${GRADIO_SERVER_PORT}
ENTRYPOINT [ ]
CMD ["python", "src/vocalizr"]