Spaces:
Sleeping
Sleeping
Mimi
commited on
Commit
·
94415c1
1
Parent(s):
cd33363
tf
Browse files- Dockerfile +3 -6
Dockerfile
CHANGED
@@ -4,21 +4,18 @@ RUN useradd -m -u 1000 user
|
|
4 |
ENV HOME=/home/user \
|
5 |
PATH=/home/user/.local/bin:$PATH
|
6 |
COPY . $HOME/app
|
7 |
-
|
8 |
-
RUN echo "The token is: ${HF_TOKEN}"
|
9 |
-
# Install dependencies
|
10 |
RUN pip install --no-cache-dir --upgrade -r $HOME/app/requirements.txt
|
11 |
|
12 |
# Switch to non-root user
|
13 |
USER user
|
14 |
-
RUN chown -R user:user $HOME
|
15 |
WORKDIR $HOME/app
|
16 |
|
17 |
-
# Expose Streamlit port
|
18 |
EXPOSE 7860
|
19 |
|
20 |
# Login to Hugging Face at runtime & Start app
|
21 |
-
CMD
|
|
|
22 |
streamlit run app.py \
|
23 |
--server.headless true \
|
24 |
--server.enableCORS false \
|
|
|
4 |
ENV HOME=/home/user \
|
5 |
PATH=/home/user/.local/bin:$PATH
|
6 |
COPY . $HOME/app
|
7 |
+
RUN chown -R user:user $HOME || true
|
|
|
|
|
8 |
RUN pip install --no-cache-dir --upgrade -r $HOME/app/requirements.txt
|
9 |
|
10 |
# Switch to non-root user
|
11 |
USER user
|
|
|
12 |
WORKDIR $HOME/app
|
13 |
|
|
|
14 |
EXPOSE 7860
|
15 |
|
16 |
# Login to Hugging Face at runtime & Start app
|
17 |
+
CMD printenv | grep HF_TOKEN && \
|
18 |
+
huggingface-cli login --token $HF_TOKEN && \
|
19 |
streamlit run app.py \
|
20 |
--server.headless true \
|
21 |
--server.enableCORS false \
|