Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +15 -7
Dockerfile
CHANGED
|
@@ -6,15 +6,23 @@ RUN apt-get update && \
|
|
| 6 |
apt-get install -y apt-utils fakeroot && \
|
| 7 |
rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
-
#
|
| 10 |
-
# - Copying files
|
| 11 |
-
# - Setting environment variables
|
| 12 |
-
# - Installing Python packages, etc.
|
| 13 |
-
|
| 14 |
-
# Example of adding a user
|
| 15 |
RUN useradd -m -u 1000 user
|
| 16 |
|
| 17 |
# Set the user for subsequent commands
|
| 18 |
USER user
|
| 19 |
|
| 20 |
-
#
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
apt-get install -y apt-utils fakeroot && \
|
| 7 |
rm -rf /var/lib/apt/lists/*
|
| 8 |
|
| 9 |
+
# Create a user for the application
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
RUN useradd -m -u 1000 user
|
| 11 |
|
| 12 |
# Set the user for subsequent commands
|
| 13 |
USER user
|
| 14 |
|
| 15 |
+
# Set the working directory
|
| 16 |
+
WORKDIR /home/user/app
|
| 17 |
+
|
| 18 |
+
# Copy the requirements.txt file into the container
|
| 19 |
+
COPY requirements.txt .
|
| 20 |
+
|
| 21 |
+
# Install the required Python packages
|
| 22 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
| 23 |
+
|
| 24 |
+
# Copy the rest of your application code into the container
|
| 25 |
+
COPY . .
|
| 26 |
+
|
| 27 |
+
# Specify the command to run your application
|
| 28 |
+
# CMD ["python", "your_script.py"]
|