iamtatsuki05 commited on
Commit
6848694
1 Parent(s): 514c4e1

Synced repo using 'sync_with_huggingface' Github Action

Browse files
Files changed (1) hide show
  1. Dockerfile +28 -0
Dockerfile CHANGED
@@ -63,4 +63,32 @@ 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
+ ## install Poetry
86
+ RUN curl -sSL https://install.python-poetry.org | python3 -
87
+ ENV PATH $PATH:/root/.local/bin
88
+ RUN poetry config virtualenvs.create true \
89
+ && poetry config virtualenvs.in-project false
90
+
91
+ RUN poetry install --no-dev
92
+ RUN poetry install
93
+
94
  CMD ["poetry", "run", "streamlit", "run", "src/app.py", "--server.port", "7860"]