diff --git a/Dockerfile b/Dockerfile index e2aa7e8..e8046f7 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,13 @@ ARG VERSION=0.0.0 ENV SETUPTOOLS_SCM_PRETEND_VERSION=${VERSION} RUN pip install --no-cache-dir --upgrade pip \ - && pip install --no-cache-dir --prefix /install .[web] + && pip install --no-cache-dir --prefix /install .[web] \ + && find /install -type d -name __pycache__ -exec rm -rf {} + 2>/dev/null || true \ + && find /install -type f -name '*.pyc' -delete \ + && find /install -type f -name '*.pyo' -delete \ + && find /install -type d -name 'tests' -exec rm -rf {} + 2>/dev/null || true \ + && find /install -type d -name 'test' -exec rm -rf {} + 2>/dev/null || true \ + && find /install -name '*.dist-info' -type d -exec sh -c 'rm -f "$1"/RECORD "$1"/INSTALLER' sh {} \; 2>/dev/null || true FROM python:3.11-slim @@ -30,9 +36,8 @@ WORKDIR /app RUN apt-get update \ && apt-get install -y --no-install-recommends ffmpeg \ - && rm -rf /var/lib/apt/lists/* - -RUN useradd --create-home --shell /usr/sbin/nologin ttsfm + && rm -rf /var/lib/apt/lists/* \ + && useradd --create-home --shell /usr/sbin/nologin ttsfm COPY --from=builder /install /usr/local ENV PATH="/usr/local/bin:$PATH"