Spaces:
Sleeping
Sleeping
reynaldyh commited on
Commit ·
75dc907
1
Parent(s): fc2f239
chore: use dockerfile
Browse files- Dockerfile +19 -25
- README.md +1 -3
Dockerfile
CHANGED
|
@@ -1,31 +1,25 @@
|
|
| 1 |
-
FROM
|
| 2 |
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
rm -rf /var/lib/apt/lists/* && \
|
| 11 |
-
useradd -m -u 1000 user
|
| 12 |
|
| 13 |
-
COPY
|
| 14 |
|
| 15 |
-
|
|
|
|
|
|
|
| 16 |
|
| 17 |
-
RUN
|
| 18 |
-
|
| 19 |
|
| 20 |
-
|
| 21 |
-
pip install --no-cache-dir datasets "huggingface-hub>=0.19" "hf-transfer>=0.1.4" "protobuf<4" "click<8.1" "pydantic~=1.0"
|
| 22 |
-
|
| 23 |
-
RUN --mount=target=/tmp/requirements.txt,source=requirements.txt --mount=target=/tmp/local_dists,source=/local_dists pip install --no-cache-dir -r /tmp/requirements.txt
|
| 24 |
-
|
| 25 |
-
RUN pip install --no-cache-dir gradio[oauth]==3.44.3 "uvicorn>=0.14.0" spaces
|
| 26 |
-
|
| 27 |
-
COPY --link --chown=1000 ./ /home/user/app
|
| 28 |
-
|
| 29 |
-
RUN pip freeze > /tmp/freeze.txt
|
| 30 |
-
|
| 31 |
-
COPY --from=pipfreeze --link --chown=1000 /tmp/freeze.txt /tmp/freeze.txt
|
|
|
|
| 1 |
+
FROM python:3.10-slim
|
| 2 |
|
| 3 |
+
ENV PYTHONUNBUFFERED=1 \
|
| 4 |
+
PYTHONDONTWRITEBYTECODE=1 \
|
| 5 |
+
PIP_NO_CACHE_DIR=off \
|
| 6 |
+
PIP_DISABLE_PIP_VERSION_CHECK=on \
|
| 7 |
+
PIP_DEFAULT_TIMEOUT=100 \
|
| 8 |
+
POETRY_HOME="/opt/poetry" \
|
| 9 |
+
POETRY_VIRTUALENVS_IN_PROJECT=true \
|
| 10 |
+
POETRY_NO_INTERACTION=1 \
|
| 11 |
+
VENV_PATH=".venv"
|
| 12 |
|
| 13 |
+
ENV PATH=${POETRY_HOME}/bin:$PATH
|
| 14 |
+
ENV PATH=${VENV_PATH}/bin:$PATH
|
|
|
|
|
|
|
| 15 |
|
| 16 |
+
COPY ./ ./
|
| 17 |
|
| 18 |
+
RUN apt-get update && apt-get install --no-install-recommends -y git curl build-essential && \
|
| 19 |
+
curl -sSL https://install.python-poetry.org | python - && \
|
| 20 |
+
chmod a+x ${POETRY_HOME}/bin/poetry
|
| 21 |
|
| 22 |
+
RUN chmod a+x ${POETRY_HOME}/bin/poetry && \
|
| 23 |
+
poetry install --without dev -vv
|
| 24 |
|
| 25 |
+
CMD ["gradio", "app.py"]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
README.md
CHANGED
|
@@ -3,9 +3,7 @@ title: PinSmart Prototype
|
|
| 3 |
emoji: 👀
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: gray
|
| 6 |
-
sdk:
|
| 7 |
-
sdk_version: 3.44.3
|
| 8 |
-
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: apache-2.0
|
| 11 |
---
|
|
|
|
| 3 |
emoji: 👀
|
| 4 |
colorFrom: indigo
|
| 5 |
colorTo: gray
|
| 6 |
+
sdk: docker
|
|
|
|
|
|
|
| 7 |
pinned: false
|
| 8 |
license: apache-2.0
|
| 9 |
---
|