ChandimaPrabath commited on
Commit
bb14784
Β·
1 Parent(s): 38a0297

fix huggingface space issue

Browse files
Files changed (2) hide show
  1. README.md +1 -1
  2. dockerfile +54 -0
README.md CHANGED
@@ -3,7 +3,7 @@ title: Load Balancer
3
  emoji: πŸš€
4
  colorFrom: yellow
5
  colorTo: red
6
- sdk: gradio
7
  sdk_version: 4.36.1
8
  app_file: app.py
9
  pinned: false
 
3
  emoji: πŸš€
4
  colorFrom: yellow
5
  colorTo: red
6
+ sdk: docker
7
  sdk_version: 4.36.1
8
  app_file: app.py
9
  pinned: false
dockerfile ADDED
@@ -0,0 +1,54 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Base image
2
+ FROM docker.io/library/python:3.10@sha256:428430918ab72109921ef55d5f8bdd3a02a90734fd79ee920146cf385a13c110
3
+
4
+ # Install additional packages and setup
5
+ RUN apt-get update && apt-get install -y \
6
+ fakeroot \
7
+ git \
8
+ git-lfs \
9
+ ffmpeg \
10
+ libsm6 \
11
+ libxext6 \
12
+ cmake \
13
+ rsync \
14
+ libgl1-mesa-glx \
15
+ && rm -rf /var/lib/apt/lists/* \
16
+ && mv /usr/bin/apt-get /usr/bin/.apt-get \
17
+ && echo '#!/usr/bin/env sh\nfakeroot /usr/bin/.apt-get $@' > /usr/bin/apt-get \
18
+ && chmod +x /usr/bin/apt-get \
19
+ && useradd -m -u 1000 user \
20
+ && git lfs install
21
+
22
+ # Set the working directory
23
+ WORKDIR /home/user/app
24
+
25
+ # Copy requirements file and install dependencies
26
+ COPY requirements.txt /tmp/requirements.txt
27
+ RUN pip install --no-cache-dir -r /tmp/requirements.txt
28
+
29
+ # Freeze the installed packages (optional)
30
+ RUN pip freeze > /tmp/freeze.txt
31
+
32
+ # Install additional Python packages
33
+ RUN pip install --no-cache-dir \
34
+ datasets \
35
+ "huggingface-hub>=0.19" \
36
+ "hf-transfer>=0.1.4" \
37
+ "protobuf<4" \
38
+ "click<8.1" \
39
+ "pydantic~=1.0" \
40
+ gradio[oauth]==4.36.1 \
41
+ "uvicorn>=0.14.0" \
42
+ spaces
43
+
44
+ # Copy the application code
45
+ COPY --chown=1000:1000 ./ /home/user/app
46
+
47
+ # Copy the freeze.txt file
48
+ COPY --chown=1000:1000 /tmp/freeze.txt /tmp/freeze.txt
49
+
50
+ # Expose the port the app runs on
51
+ EXPOSE 7860
52
+
53
+ # Set the entry point to run the Flask application
54
+ ENTRYPOINT ["python", "app.py"]