Spaces:
Sleeping
Sleeping
j
commited on
Commit
·
6fd9cf8
1
Parent(s):
170e15c
revert to previous Dockerfile
Browse files- Dockerfile +30 -27
Dockerfile
CHANGED
|
@@ -1,53 +1,56 @@
|
|
| 1 |
-
FROM swaggerapi/swagger-ui:v4.18.2 AS swagger-ui
|
| 2 |
-
FROM nvidia/cuda:11.8.0-cudnn8-runtime-ubuntu22.04
|
| 3 |
-
|
| 4 |
ENV PYTHON_VERSION=3.10
|
| 5 |
ENV POETRY_VENV=/app/.venv
|
|
|
|
|
|
|
| 6 |
|
| 7 |
RUN export DEBIAN_FRONTEND=noninteractive \
|
| 8 |
&& apt-get -qq update \
|
| 9 |
-
&& apt-get -qq install --no-install-recommends \
|
| 10 |
-
python${PYTHON_VERSION} \
|
| 11 |
-
python${PYTHON_VERSION}-venv \
|
| 12 |
-
python3-pip \
|
| 13 |
-
lua5.3 \
|
| 14 |
-
lua5.4 \
|
| 15 |
-
lua-check \
|
| 16 |
-
fswatch \
|
| 17 |
-
make \
|
| 18 |
-
ffmpeg \
|
| 19 |
-
redis \
|
| 20 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 21 |
-
|
| 22 |
-
RUN ln -s -f /usr/bin/python${PYTHON_VERSION} /usr/bin/python3 && \
|
| 23 |
ln -s -f /usr/bin/python${PYTHON_VERSION} /usr/bin/python && \
|
| 24 |
ln -s -f /usr/bin/pip3 /usr/bin/pip
|
| 25 |
|
| 26 |
-
RUN
|
| 27 |
-
|
| 28 |
-
&& $POETRY_VENV/bin/pip install poetry==1.6.1
|
| 29 |
|
| 30 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
|
| 32 |
WORKDIR /app
|
| 33 |
|
| 34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 35 |
|
| 36 |
RUN poetry config virtualenvs.in-project true
|
| 37 |
RUN poetry install --no-root
|
| 38 |
|
| 39 |
-
|
| 40 |
-
COPY --from=swagger-ui /usr/share/nginx/html/swagger-ui.css swagger-ui-assets/swagger-ui.css
|
| 41 |
-
COPY --from=swagger-ui /usr/share/nginx/html/swagger-ui-bundle.js swagger-ui-assets/swagger-ui-bundle.js
|
| 42 |
|
| 43 |
-
RUN poetry install && rm -rf /root/.cache/pypoetry
|
| 44 |
RUN $POETRY_VENV/bin/pip install --no-cache-dir torch==1.13.1+cu117 -f https://download.pytorch.org/whl/torch
|
| 45 |
|
| 46 |
WORKDIR /app/reascripts/ReaSpeech
|
|
|
|
|
|
|
|
|
|
| 47 |
RUN make publish
|
|
|
|
| 48 |
WORKDIR /app
|
| 49 |
RUN rm -rf reascripts
|
| 50 |
|
| 51 |
ENTRYPOINT ["python3", "app/run.py"]
|
| 52 |
|
| 53 |
-
EXPOSE 9000
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
ENV PYTHON_VERSION=3.10
|
| 2 |
ENV POETRY_VENV=/app/.venv
|
| 3 |
+
ENV HF_HOME="/app/.cache"
|
| 4 |
+
ENV ASR_MODEL_PATH="/app/.cache"
|
| 5 |
|
| 6 |
RUN export DEBIAN_FRONTEND=noninteractive \
|
| 7 |
&& apt-get -qq update \
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 8 |
ln -s -f /usr/bin/python${PYTHON_VERSION} /usr/bin/python && \
|
| 9 |
ln -s -f /usr/bin/pip3 /usr/bin/pip
|
| 10 |
|
| 11 |
+
RUN groupadd -g $SERVICE_GID $SERVICE_USER && \
|
| 12 |
+
useradd -u $SERVICE_UID -g $SERVICE_GID -d /app -s /usr/sbin/nologin $SERVICE_USER
|
|
|
|
| 13 |
|
| 14 |
+
|
| 15 |
+
RUN getent group $SERVICE_USER
|
| 16 |
+
RUN getent passwd $SERVICE_USER
|
| 17 |
+
|
| 18 |
+
COPY --chown=$SERVICE_UID:$SERVICE_GID . /app
|
| 19 |
+
COPY --chown=$SERVICE_UID:$SERVICE_GID --from=swagger-ui /usr/share/nginx/html/swagger-ui.css /app/swagger-ui-assets/swagger-ui.css
|
| 20 |
+
COPY --chown=$SERVICE_UID:$SERVICE_GID --from=swagger-ui /usr/share/nginx/html/swagger-ui-bundle.js /app/swagger-ui-assets/swagger-ui-bundle.js
|
| 21 |
+
|
| 22 |
+
RUN chown -R $SERVICE_UID:$SERVICE_GID /app
|
| 23 |
+
|
| 24 |
+
RUN ls -la /app
|
| 25 |
+
RUN mkdir -p /app/.cache && chown -R $SERVICE_UID:$SERVICE_GID /app/.cache && ls -la /app/.cache
|
| 26 |
+
|
| 27 |
+
USER $SERVICE_USER
|
| 28 |
|
| 29 |
WORKDIR /app
|
| 30 |
|
| 31 |
+
RUN python3 -m venv $POETRY_VENV && $POETRY_VENV/bin/pip install -U pip setuptools && \
|
| 32 |
+
$POETRY_VENV/bin/pip install poetry==1.6.1
|
| 33 |
+
|
| 34 |
+
ENV PATH="${PATH}:${POETRY_VENV}/bin"
|
| 35 |
+
|
| 36 |
+
COPY --chown=$SERVICE_UID:$SERVICE_GID poetry.lock pyproject.toml ./
|
| 37 |
|
| 38 |
RUN poetry config virtualenvs.in-project true
|
| 39 |
RUN poetry install --no-root
|
| 40 |
|
| 41 |
+
RUN poetry install && rm -rf /app/.cache/pypoetry
|
|
|
|
|
|
|
| 42 |
|
|
|
|
| 43 |
RUN $POETRY_VENV/bin/pip install --no-cache-dir torch==1.13.1+cu117 -f https://download.pytorch.org/whl/torch
|
| 44 |
|
| 45 |
WORKDIR /app/reascripts/ReaSpeech
|
| 46 |
+
|
| 47 |
+
RUN ls -la /app/reascripts/ReaSpeech
|
| 48 |
+
|
| 49 |
RUN make publish
|
| 50 |
+
|
| 51 |
WORKDIR /app
|
| 52 |
RUN rm -rf reascripts
|
| 53 |
|
| 54 |
ENTRYPOINT ["python3", "app/run.py"]
|
| 55 |
|
| 56 |
+
EXPOSE 9000
|