skytnt commited on
Commit
3538c2d
•
1 Parent(s): 743aa2c
Files changed (3) hide show
  1. Dockerfile +42 -0
  2. README.md +2 -2
  3. requirements.txt +1 -1
Dockerfile ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ FROM nvidia/cuda:11.6.1-cudnn8-devel-ubuntu20.04
2
+
3
+ ARG DEBIAN_FRONTEND=noninteractive
4
+
5
+ ENV PYTHONUNBUFFERED=1
6
+
7
+ RUN apt-get update && apt-get install --no-install-recommends -y \
8
+ build-essential \
9
+ python3.9 \
10
+ python3-pip \
11
+ git \
12
+ ffmpeg \
13
+ && apt-get clean && rm -rf /var/lib/apt/lists/*
14
+
15
+ WORKDIR /code
16
+
17
+ COPY ./requirements.txt /code/requirements.txt
18
+
19
+ # Set up a new user named "user" with user ID 1000
20
+ RUN useradd -m -u 1000 user
21
+ # Switch to the "user" user
22
+ USER user
23
+ # Set home to the user's home directory
24
+ ENV HOME=/home/user \
25
+ PATH=/home/user/.local/bin:$PATH \
26
+ PYTHONPATH=$HOME/app \
27
+ PYTHONUNBUFFERED=1 \
28
+ GRADIO_ALLOW_FLAGGING=never \
29
+ GRADIO_NUM_PORTS=1 \
30
+ GRADIO_SERVER_NAME=0.0.0.0 \
31
+ GRADIO_THEME=huggingface \
32
+ SYSTEM=spaces
33
+
34
+ RUN pip3 install --no-cache-dir --upgrade -r /code/requirements.txt
35
+
36
+ # Set the working directory to the user's home directory
37
+ WORKDIR $HOME/app
38
+
39
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
40
+ COPY --chown=user . $HOME/app
41
+
42
+ CMD ["python3", "app.py"]
README.md CHANGED
@@ -3,10 +3,10 @@ title: Midi Music Generator
3
  emoji: 🎼🎶
4
  colorFrom: red
5
  colorTo: indigo
6
- sdk: gradio
7
  sdk_version: 4.36.0
8
  app_file: app.py
9
- pinned: false
10
  license: apache-2.0
11
  ---
12
 
 
3
  emoji: 🎼🎶
4
  colorFrom: red
5
  colorTo: indigo
6
+ sdk: docker
7
  sdk_version: 4.36.0
8
  app_file: app.py
9
+ pinned: true
10
  license: apache-2.0
11
  ---
12
 
requirements.txt CHANGED
@@ -1,5 +1,5 @@
1
  Pillow
2
  numpy
3
  onnxruntime-gpu
4
- gradio
5
  pyfluidsynth
 
1
  Pillow
2
  numpy
3
  onnxruntime-gpu
4
+ gradio==4.36.0
5
  pyfluidsynth