fix dockerfile for HuggingfaceSpace
Browse files- Dockerfile +9 -3
Dockerfile
CHANGED
@@ -1,16 +1,22 @@
|
|
1 |
FROM python:3.10
|
2 |
|
|
|
|
|
|
|
3 |
USER user
|
|
|
|
|
4 |
ENV HOME=/home/user \
|
5 |
PATH=/home/user/.local/bin:$PATH
|
6 |
|
|
|
7 |
WORKDIR $HOME/app
|
8 |
|
9 |
RUN mkdir ./texteditor-model
|
10 |
-
COPY . .
|
11 |
|
12 |
-
RUN apt-get update && apt-get -y upgrade
|
13 |
-
RUN apt-get install -y build-essential
|
14 |
RUN pip3 install --upgrade pip setuptools
|
15 |
RUN pip3 install -r requirements.txt
|
16 |
RUN python3 -m spacy download en_core_web_sm
|
|
|
1 |
FROM python:3.10
|
2 |
|
3 |
+
RUN useradd -m -u 1000 user
|
4 |
+
|
5 |
+
# Switch to the "user" user
|
6 |
USER user
|
7 |
+
|
8 |
+
# Set home to the user's home directory
|
9 |
ENV HOME=/home/user \
|
10 |
PATH=/home/user/.local/bin:$PATH
|
11 |
|
12 |
+
# Set the working directory to the user's home directory
|
13 |
WORKDIR $HOME/app
|
14 |
|
15 |
RUN mkdir ./texteditor-model
|
16 |
+
COPY --chown=user . .
|
17 |
|
18 |
+
# RUN apt-get update && apt-get -y upgrade
|
19 |
+
# RUN apt-get install -y build-essential
|
20 |
RUN pip3 install --upgrade pip setuptools
|
21 |
RUN pip3 install -r requirements.txt
|
22 |
RUN python3 -m spacy download en_core_web_sm
|