Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +10 -17
Dockerfile
CHANGED
@@ -1,21 +1,14 @@
|
|
1 |
-
|
|
|
2 |
|
3 |
-
# Set
|
4 |
-
|
5 |
|
6 |
-
#
|
7 |
-
|
8 |
|
9 |
-
#
|
10 |
-
|
11 |
-
PATH=/home/user/.local/bin:$PATH
|
12 |
-
|
13 |
-
# Set the working directory to the user's home directory
|
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 pip install --no-cache-dir --upgrade pip
|
18 |
-
|
19 |
-
# Copy the current directory contents into the container at $HOME/app setting the owner to the user
|
20 |
-
COPY --chown=user run_job.py requirements.txt README.md $HOME/app/
|
21 |
|
|
|
|
|
|
1 |
+
# Use an official lightweight Python image as base
|
2 |
+
FROM python:3.11-slim
|
3 |
|
4 |
+
# Set the working directory inside the container
|
5 |
+
WORKDIR /app
|
6 |
|
7 |
+
# Copy the current directory contents into the container at /app
|
8 |
+
COPY . /app
|
9 |
|
10 |
+
# Install any dependencies specified in requirements.txt
|
11 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
12 |
|
13 |
+
# Define the command to run the application
|
14 |
+
CMD ["python", "app.py"]
|