Spaces:
Runtime error
Runtime error
Commit
·
113ec44
1
Parent(s):
836bdb6
add permissions for user
Browse files- Dockerfile +17 -17
Dockerfile
CHANGED
@@ -10,22 +10,7 @@
|
|
10 |
# # we are using open AI here. no need to download model
|
11 |
# # RUN python3 -c 'from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM;model=AutoModelForSeq2SeqLM.from_pretrained("facebook/bart-large-cnn");model.save_pretrained("models");tokenizer=AutoTokenizer.from_pretrained("facebook/bart-large-cnn");tokenizer.save_pretrained("models")'
|
12 |
|
13 |
-
|
14 |
-
# RUN useradd -m -u 1000 user
|
15 |
-
# # Switch to the "user" user
|
16 |
-
# USER user
|
17 |
-
# # Set home to the user's home directory
|
18 |
-
# ENV HOME=/home/user
|
19 |
-
# ENV PATH=/home/user/.local/bin:$PATH
|
20 |
-
|
21 |
-
# # Set the working directory to the user's home directory
|
22 |
-
# WORKDIR $HOME
|
23 |
-
# RUN mkdir app
|
24 |
-
# WORKDIR $HOME/app
|
25 |
-
# COPY . $HOME/app
|
26 |
-
|
27 |
-
# # Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
28 |
-
# # COPY --chown=user . $HOME/app
|
29 |
|
30 |
# # COPY ./app /code/app
|
31 |
|
@@ -41,7 +26,22 @@ WORKDIR /app
|
|
41 |
COPY requirements.txt ./requirements.txt
|
42 |
RUN pip install -r requirements.txt
|
43 |
EXPOSE 8501
|
44 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
45 |
# ENTRYPOINT ["streamlit", "run"]
|
46 |
# CMD ["app.py", "--server.port", "7860", "--server.enableCORS, false", "--server.enableXsrfProtection, false", "--server.fileWatcherType, none"]
|
47 |
|
|
|
10 |
# # we are using open AI here. no need to download model
|
11 |
# # RUN python3 -c 'from transformers import pipeline, AutoTokenizer, AutoModelForSeq2SeqLM;model=AutoModelForSeq2SeqLM.from_pretrained("facebook/bart-large-cnn");model.save_pretrained("models");tokenizer=AutoTokenizer.from_pretrained("facebook/bart-large-cnn");tokenizer.save_pretrained("models")'
|
12 |
|
13 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
14 |
|
15 |
# # COPY ./app /code/app
|
16 |
|
|
|
26 |
COPY requirements.txt ./requirements.txt
|
27 |
RUN pip install -r requirements.txt
|
28 |
EXPOSE 8501
|
29 |
+
# Set up a new user named "user" with user ID 1000
|
30 |
+
RUN useradd -m -u 1000 user
|
31 |
+
# Switch to the "user" user
|
32 |
+
USER user
|
33 |
+
# Set home to the user's home directory
|
34 |
+
ENV HOME=/home/user
|
35 |
+
ENV PATH=/home/user/.local/bin:$PATH
|
36 |
+
|
37 |
+
# Set the working directory to the user's home directory
|
38 |
+
WORKDIR $HOME
|
39 |
+
RUN mkdir app
|
40 |
+
WORKDIR $HOME/app
|
41 |
+
COPY . $HOME/app
|
42 |
+
|
43 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
44 |
+
COPY --chown=user . $HOME/app
|
45 |
# ENTRYPOINT ["streamlit", "run"]
|
46 |
# CMD ["app.py", "--server.port", "7860", "--server.enableCORS, false", "--server.enableXsrfProtection, false", "--server.fileWatcherType, none"]
|
47 |
|