Update Dockerfile
#8
by
rsn86
- opened
- Dockerfile +8 -6
Dockerfile
CHANGED
|
@@ -11,15 +11,16 @@ RUN apt-get update \
|
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
RUN python -m pip install --upgrade pip \
|
| 14 |
-
&& pip install build \
|
| 15 |
-
&& pip install -r /code/src/requirements.txt
|
| 16 |
|
| 17 |
RUN cd /code/src \
|
| 18 |
&& cd frontend \
|
| 19 |
&& npm i -D @gradio/preview@0.11.2 \
|
| 20 |
&& cd .. \
|
|
|
|
| 21 |
&& gradio cc install \
|
| 22 |
-
&& gradio cc build
|
| 23 |
|
| 24 |
FROM python:3.11-slim as final
|
| 25 |
|
|
@@ -37,6 +38,7 @@ COPY --from=builder --chown=appuser:appgroup /code/src/dist/*.whl ./
|
|
| 37 |
USER appuser
|
| 38 |
|
| 39 |
ENV PATH="/home/appuser/.local/bin:$PATH" \
|
|
|
|
| 40 |
TRANSFORMERS_CACHE=/tmp/cache/ \
|
| 41 |
PYTHONUNBUFFERED=1 \
|
| 42 |
GRADIO_ALLOW_FLAGGING=never \
|
|
@@ -45,8 +47,8 @@ ENV PATH="/home/appuser/.local/bin:$PATH" \
|
|
| 45 |
GRADIO_SERVER_PORT=7860 \
|
| 46 |
SYSTEM=spaces
|
| 47 |
|
| 48 |
-
RUN python -m pip install --upgrade pip \
|
| 49 |
-
&& pip install ./gradio_highlightedtextbox*.whl
|
| 50 |
|
| 51 |
EXPOSE 7860
|
| 52 |
-
CMD ["python", "app.py"]
|
|
|
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
RUN python -m pip install --upgrade pip \
|
| 14 |
+
&& python -m pip install build \
|
| 15 |
+
&& python -m pip install -r /code/src/requirements.txt
|
| 16 |
|
| 17 |
RUN cd /code/src \
|
| 18 |
&& cd frontend \
|
| 19 |
&& npm i -D @gradio/preview@0.11.2 \
|
| 20 |
&& cd .. \
|
| 21 |
+
&& rm -rf dist \
|
| 22 |
&& gradio cc install \
|
| 23 |
+
&& gradio cc build --bump-version
|
| 24 |
|
| 25 |
FROM python:3.11-slim as final
|
| 26 |
|
|
|
|
| 38 |
USER appuser
|
| 39 |
|
| 40 |
ENV PATH="/home/appuser/.local/bin:$PATH" \
|
| 41 |
+
PYTHONPATH="/home/appuser/.local/lib/python3.11/site-packages" \
|
| 42 |
TRANSFORMERS_CACHE=/tmp/cache/ \
|
| 43 |
PYTHONUNBUFFERED=1 \
|
| 44 |
GRADIO_ALLOW_FLAGGING=never \
|
|
|
|
| 47 |
GRADIO_SERVER_PORT=7860 \
|
| 48 |
SYSTEM=spaces
|
| 49 |
|
| 50 |
+
RUN python -m pip install --upgrade pip --no-cache-dir \
|
| 51 |
+
&& python -m pip install ./gradio_highlightedtextbox*.whl --no-cache-dir
|
| 52 |
|
| 53 |
EXPOSE 7860
|
| 54 |
+
CMD ["python", "app.py"]
|