yonikremer
commited on
Commit
•
adc866e
1
Parent(s):
f3b9ee3
attempt 4 to resolve permission error
Browse files- Dockerfile +6 -21
Dockerfile
CHANGED
@@ -1,28 +1,11 @@
|
|
1 |
FROM bitnami/pytorch
|
2 |
|
3 |
-
|
4 |
-
WORKDIR /
|
5 |
|
6 |
-
|
7 |
-
COPY ./requirements.txt /code/requirements.txt
|
8 |
|
9 |
-
|
10 |
-
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
11 |
-
|
12 |
-
# Set up a new user named "user" with user ID 1000
|
13 |
-
RUN useradd -m -u 1000 user
|
14 |
-
# Switch to the "user" user
|
15 |
-
USER user
|
16 |
-
# Set home to the user's home directory
|
17 |
-
ENV HOME=/home/user
|
18 |
-
# Add the user's home directory to the PATH
|
19 |
-
ENV PATH=/home/user/.local/bin:$PATH
|
20 |
-
|
21 |
-
# Set the working directory to the user's home directory
|
22 |
-
WORKDIR $HOME/app
|
23 |
-
|
24 |
-
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
25 |
-
COPY --chown=user . $HOME/app
|
26 |
|
27 |
RUN mkdir "/app/.cache/"
|
28 |
RUN mkdir "/app/.cache/huggingface/"
|
@@ -30,4 +13,6 @@ ENV HUGGINGFACE_HUB_CACHE="/app/.cache/huggingface"
|
|
30 |
RUN mkdir "/app/.cache/transformers/"
|
31 |
ENV TRANSFORMERS_CACHE="/app/.cache/transformers"
|
32 |
|
|
|
|
|
33 |
CMD ["streamlit", "run", "/app/app.py"]
|
|
|
1 |
FROM bitnami/pytorch
|
2 |
|
3 |
+
RUN mkdir --mode 777 /app
|
4 |
+
WORKDIR /app
|
5 |
|
6 |
+
COPY ./requirements.txt /app/requirements.txt
|
|
|
7 |
|
8 |
+
RUN pip install --no-cache-dir -r /app/requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
9 |
|
10 |
RUN mkdir "/app/.cache/"
|
11 |
RUN mkdir "/app/.cache/huggingface/"
|
|
|
13 |
RUN mkdir "/app/.cache/transformers/"
|
14 |
ENV TRANSFORMERS_CACHE="/app/.cache/transformers"
|
15 |
|
16 |
+
COPY . /app
|
17 |
+
|
18 |
CMD ["streamlit", "run", "/app/app.py"]
|