reynaldyh commited on
Commit
75dc907
·
1 Parent(s): fc2f239

chore: use dockerfile

Browse files
Files changed (2) hide show
  1. Dockerfile +19 -25
  2. README.md +1 -3
Dockerfile CHANGED
@@ -1,31 +1,25 @@
1
- FROM docker.io/library/python:3.10
2
 
3
- RUN apt-get update && \
4
- apt-get install -y git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1-mesa-glx && \
5
- rm -rf /var/lib/apt/lists/* && \
6
- git lfs install
 
 
 
 
 
7
 
8
- RUN apt-get update && apt-get install -y fakeroot && \
9
- mv /usr/bin/apt-get /usr/bin/.apt-get && echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get $@' > /usr/bin/apt-get && chmod +x /usr/bin/apt-get && \
10
- rm -rf /var/lib/apt/lists/* && \
11
- useradd -m -u 1000 user
12
 
13
- COPY --chown=1000:1000 --from=root / /
14
 
15
- WORKDIR /home/user/app
 
 
16
 
17
- RUN ls
18
- RUN dir -s
19
 
20
- RUN pip install --no-cache-dir pip==22.3.1 && \
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: gradio
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
  ---