not-lain commited on
Commit
58a633f
β€’
1 Parent(s): e886c30

switch to docker

Browse files
Files changed (3) hide show
  1. .gitignore +1 -0
  2. Dockerfile +32 -0
  3. README.md +1 -1
.gitignore ADDED
@@ -0,0 +1 @@
 
 
1
+ env*
Dockerfile ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM docker.io/library/python:3.10@sha256:1560bbdbfab7ac8d4aa10857b62fc3f3759d3aa3957e2f5be62362e9c6b8eda6
2
+
3
+ RUN apt-get update && apt-get install -y fakeroot && 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 && rm -rf /var/lib/apt/lists/* && useradd -m -u 1000 user
4
+
5
+ RUN pip install --no-cache-dir pip==22.3.1 && pip install --no-cache-dir datasets "huggingface-hub>=0.19" "hf-transfer>=0.1.4" "protobuf<4" "click<8.1" "pydantic~=1.0"
6
+
7
+ RUN --mount=target=/tmp/packages.txt,source=packages.txt apt-get update && xargs -r -a /tmp/packages.txt apt-get install -y && apt-get install -y curl && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && apt-get install -y nodejs && rm -rf /var/lib/apt/lists/* && apt-get clean
8
+
9
+ RUN apt-get update && apt-get install -y git git-lfs ffmpeg libsm6 libxext6 cmake rsync libgl1-mesa-glx && rm -rf /var/lib/apt/lists/* && git lfs install
10
+
11
+
12
+ COPY --chown=1000:1000 --from=root / /
13
+
14
+ WORKDIR /home/user/app
15
+
16
+ RUN --mount=target=/tmp/requirements.txt,source=requirements.txt pip install --no-cache-dir -r /tmp/requirements.txt
17
+
18
+
19
+
20
+ RUN pip freeze > /tmp/freeze.txt
21
+
22
+ RUN pip install --no-cache-dir gradio[oauth]==5.4.0 "uvicorn>=0.14.0" spaces
23
+
24
+
25
+ COPY --link --chown=1000 ./ /home/user/app
26
+
27
+ RUN ln -s /usr/lib/python3/dist-packages/uno.py /usr/local/lib/python3.10/site-packages/
28
+ RUN ln -s /usr/lib/python3/dist-packages/unohelper.py /usr/local/lib/python3.10/site-packages/
29
+
30
+ COPY --from=pipfreeze --link --chown=1000 /tmp/freeze.txt /tmp/freeze.txt
31
+
32
+ CMD ["python", "app.py"]
README.md CHANGED
@@ -3,7 +3,7 @@ title: Utils
3
  emoji: 🌍
4
  colorFrom: indigo
5
  colorTo: gray
6
- sdk: gradio
7
  sdk_version: 5.4.0
8
  app_file: app.py
9
  pinned: false
 
3
  emoji: 🌍
4
  colorFrom: indigo
5
  colorTo: gray
6
+ sdk: docker
7
  sdk_version: 5.4.0
8
  app_file: app.py
9
  pinned: false