Spaces:
Running
Running
Commit
·
2fd1c43
1
Parent(s):
a5a0ddd
Try packages.txt
Browse files- Dockerfile +6 -3
Dockerfile
CHANGED
|
@@ -1,8 +1,5 @@
|
|
| 1 |
FROM python:3.11
|
| 2 |
|
| 3 |
-
RUN apt-get update
|
| 4 |
-
RUN xargs -a packages.txt apt-get --yes install
|
| 5 |
-
|
| 6 |
# Set up a new user named "user" with user ID 1000
|
| 7 |
RUN useradd -m -u 1000 user
|
| 8 |
|
|
@@ -17,11 +14,17 @@ ENV HOME=/home/user \
|
|
| 17 |
WORKDIR $HOME/app
|
| 18 |
|
| 19 |
# Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
|
|
|
|
|
|
|
| 20 |
RUN pip install --no-cache-dir --upgrade pip
|
| 21 |
|
| 22 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 23 |
COPY --chown=user . $HOME/app
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
COPY --chown=user requirements.txt .
|
| 26 |
|
| 27 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
|
|
|
| 1 |
FROM python:3.11
|
| 2 |
|
|
|
|
|
|
|
|
|
|
| 3 |
# Set up a new user named "user" with user ID 1000
|
| 4 |
RUN useradd -m -u 1000 user
|
| 5 |
|
|
|
|
| 14 |
WORKDIR $HOME/app
|
| 15 |
|
| 16 |
# Try and run pip command after setting the user with `USER user` to avoid permission issues with Python
|
| 17 |
+
RUN apt-get update
|
| 18 |
+
|
| 19 |
RUN pip install --no-cache-dir --upgrade pip
|
| 20 |
|
| 21 |
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
| 22 |
COPY --chown=user . $HOME/app
|
| 23 |
|
| 24 |
+
COPY --chown=user packages.txt .
|
| 25 |
+
|
| 26 |
+
RUN xargs -a packages.txt apt-get --yes install
|
| 27 |
+
|
| 28 |
COPY --chown=user requirements.txt .
|
| 29 |
|
| 30 |
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|