Spaces:
Sleeping
Sleeping
Dockerfile changes WORKDIR
Browse files- Dockerfile +8 -11
Dockerfile
CHANGED
@@ -1,28 +1,25 @@
|
|
1 |
-
FROM python:3.
|
2 |
|
3 |
WORKDIR /code
|
4 |
|
5 |
COPY ./requirements.txt requirements.txt
|
6 |
-
COPY ./static static/
|
7 |
-
COPY ./components components/
|
8 |
-
COPY ./app.py app.py
|
9 |
-
|
10 |
-
RUN ls -alt
|
11 |
|
12 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
13 |
|
14 |
-
# Set up a new user named "user" with user ID 1000
|
15 |
RUN useradd -m -u 1000 user
|
16 |
-
|
17 |
USER user
|
18 |
# Set home to the user's home directory
|
19 |
ENV HOME=/home/user \
|
20 |
-
PATH=/home/user/.local/bin:$PATH
|
|
|
21 |
|
22 |
-
# Set the working directory to the user's home directory
|
23 |
WORKDIR $HOME/app
|
24 |
|
25 |
-
|
|
|
|
|
|
|
26 |
COPY --chown=user . $HOME/app
|
27 |
|
28 |
CMD ["python", "app.py"]
|
|
|
1 |
+
FROM python:3.10
|
2 |
|
3 |
WORKDIR /code
|
4 |
|
5 |
COPY ./requirements.txt requirements.txt
|
|
|
|
|
|
|
|
|
|
|
6 |
|
7 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
8 |
|
|
|
9 |
RUN useradd -m -u 1000 user
|
10 |
+
|
11 |
USER user
|
12 |
# Set home to the user's home directory
|
13 |
ENV HOME=/home/user \
|
14 |
+
PATH=/home/user/.local/bin:$PATH\
|
15 |
+
NLTK_DATA=/home/user/app/static/nltk
|
16 |
|
|
|
17 |
WORKDIR $HOME/app
|
18 |
|
19 |
+
RUN chmod -R 777
|
20 |
+
RUN pwd
|
21 |
+
RUN ls -alt
|
22 |
+
|
23 |
COPY --chown=user . $HOME/app
|
24 |
|
25 |
CMD ["python", "app.py"]
|