forked from LuckLittleBoy/SenseVoice-OneApi
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
33 lines (24 loc) · 950 Bytes
/
Dockerfile
File metadata and controls
33 lines (24 loc) · 950 Bytes
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
30
31
32
33
FROM python:3.11-slim AS builder
WORKDIR /app
COPY .python-version pyproject.toml uv.lock ./
COPY src src
ENV UV_HTTP_TIMEOUT=300 \
UV_LINK_MODE=copy
RUN pip install uv && uv sync -v --frozen --no-install-project
FROM python:3.11-slim AS production
LABEL org.opencontainers.image.authors="Pengxuan Men <pengxuan.men@gmail.com>" maintainer="Pengxuan Men <pengxuan.men@gmail.com>"
RUN apt-get update && \
apt-get install -y --no-install-recommends curl && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
VOLUME /app/logs
EXPOSE 9991
COPY --from=builder /app/.venv .venv
COPY --from=builder /app/src src
COPY --from=mwader/static-ffmpeg:6.1.1 /ffmpeg /usr/local/bin/
ENV PATH="/app/.venv/bin:$PATH" \
PYTHONUNBUFFERED=1 \
PYTHONDONTWRITEBYTECODE=1
CMD ["python", "-m", "src.main"]
HEALTHCHECK --interval=30s --timeout=10s --start-period=300s --retries=3 \
CMD curl -sf http://localhost:${PORT:-9991}/health | grep -qv '"DOWN"'