iamtatsuki05 commited on
Commit
7ed3a75
·
verified ·
1 Parent(s): 0338d23

Synced repo using 'sync_with_huggingface' Github Action

Browse files
Files changed (1) hide show
  1. Dockerfile +21 -0
Dockerfile CHANGED
@@ -63,4 +63,25 @@ COPY src ./src
63
  RUN poetry install
64
 
65
  # Hugging Face Hub Settings
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
66
  CMD ["poetry", "run", "streamlit", "run", "src/app.py", "--server.port", "7860"]
 
63
  RUN poetry install
64
 
65
  # Hugging Face Hub Settings
66
+ FROM dev AS hf
67
+ WORKDIR ${WORKDIR}
68
+
69
+ # REF: https://huggingface.co/docs/hub/spaces-sdks-docker-first-demo#:~:text=As%20discussed%20in,the%20Dockerfile.
70
+ # Set up a new user named "user" with user ID 1000
71
+ RUN useradd -m -u 1000 user
72
+
73
+ # Switch to the "user" user
74
+ USER user
75
+
76
+ # Set home to the user's home directory
77
+ ENV HOME=/home/user \
78
+ PATH=/home/user/.local/bin:$PATH
79
+
80
+ # Set the working directory to the user's home directory
81
+ WORKDIR $HOME/app
82
+
83
+ # Copy the current directory contents into the container at $HOME/app setting the owner to the user
84
+ COPY --chown=user . $HOME/app
85
+
86
+
87
  CMD ["poetry", "run", "streamlit", "run", "src/app.py", "--server.port", "7860"]