cwenger commited on
Commit
3e73349
·
verified ·
1 Parent(s): 2e19c63

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +12 -0
Dockerfile ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM docker.io/library/python:3.10@sha256:d47cb1b09be409a0cb5efeb01dd3ff5d44a5e28d371fa1a736c8928ab72fffd2
2
+ 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
3
+ 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
4
+ COPY --chown=1000:1000 --from=root / /
5
+ RUN --mount=target=/tmp/requirements.txt,source=requirements.txt pip install --no-cache-dir -r /tmp/requirements.txt
6
+ RUN --mount=target=/tmp/packages.txt,source=packages.txt apt-get update && xargs -r -a /tmp/packages.txt apt-get install -y && rm -rf /var/lib/apt/lists/*
7
+ WORKDIR /home/user/app
8
+ 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"
9
+ RUN pip freeze > /tmp/freeze.txt
10
+ RUN pip install --no-cache-dir gradio[oauth]==4.38.1 "uvicorn>=0.14.0" spaces
11
+ COPY --link --chown=1000 ./ /home/user/app
12
+ COPY --from=pipfreeze --link --chown=1000 /tmp/freeze.txt /tmp/freeze.txt