caviri
commited on
Commit
·
f92f2c1
1
Parent(s):
f81b2a4
ci: Testing HF
Browse files- Dockerfile +18 -6
Dockerfile
CHANGED
@@ -37,15 +37,27 @@ RUN apt-get update && apt-get -y upgrade \
|
|
37 |
# ODTP setup
|
38 |
##################################################
|
39 |
|
40 |
-
|
41 |
-
RUN
|
42 |
|
43 |
-
|
44 |
USER user
|
45 |
|
46 |
-
|
|
|
|
|
47 |
|
48 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
-
WORKDIR /digiwild
|
51 |
ENTRYPOINT python3 app/main.py
|
|
|
37 |
# ODTP setup
|
38 |
##################################################
|
39 |
|
40 |
+
# Set up a new user named "user" with user ID 1000
|
41 |
+
RUN useradd -m -u 1000 user
|
42 |
|
43 |
+
# Switch to the "user" user
|
44 |
USER user
|
45 |
|
46 |
+
# Set home to the user's home directory
|
47 |
+
ENV HOME=/home/user \
|
48 |
+
PATH=/home/user/.local/bin:$PATH
|
49 |
|
50 |
+
# Set the working directory to the user's home directory
|
51 |
+
WORKDIR $HOME/digiwild
|
52 |
+
|
53 |
+
# Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
|
54 |
+
RUN pip install --no-cache-dir --upgrade pip
|
55 |
+
|
56 |
+
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
57 |
+
COPY --chown=user . $HOME/digiwild
|
58 |
+
|
59 |
+
RUN pip3 install -r $HOME/digiwild/requirements.txt
|
60 |
+
|
61 |
+
#RUN chown -R user:user /digiwild/data /digiwild/app/assets
|
62 |
|
|
|
63 |
ENTRYPOINT python3 app/main.py
|