jingyangcarl commited on
Commit
b530596
·
1 Parent(s): c673bef
Files changed (2) hide show
  1. DockerFile +28 -0
  2. README.md +1 -1
DockerFile ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # read the doc: https://huggingface.co/docs/hub/spaces-sdks-docker
2
+ # you will also find guides on how best to write your Dockerfile
3
+
4
+ FROM python:3.11
5
+
6
+ WORKDIR /code
7
+
8
+ COPY ./pre-requirements.txt /code/pre-requirements.txt
9
+
10
+ RUN pip install --no-cache-dir --upgrade -r /code/pre-requirements.txt
11
+
12
+ # Set up a new user named "user" with user ID 1000
13
+ RUN useradd -m -u 1000 user
14
+
15
+ # Switch to the "user" user
16
+ USER user
17
+
18
+ # Set home to the user's home directory
19
+ ENV HOME=/home/user \
20
+ PATH=/home/user/.local/bin:$PATH
21
+
22
+ # Set the working directory to the user's home directory
23
+ WORKDIR $HOME/app
24
+
25
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
26
+ COPY --chown=user . $HOME/app
27
+
28
+ CMD ["python", "app.py"]
README.md CHANGED
@@ -3,7 +3,7 @@ title: Matgen
3
  emoji: 🖼
4
  colorFrom: purple
5
  colorTo: red
6
- sdk: gradio
7
  python_version: 3.11
8
  sdk_version: 5.25.2
9
  app_file: app.py
 
3
  emoji: 🖼
4
  colorFrom: purple
5
  colorTo: red
6
+ sdk: docker
7
  python_version: 3.11
8
  sdk_version: 5.25.2
9
  app_file: app.py