Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +18 -18
Dockerfile
CHANGED
|
@@ -1,26 +1,26 @@
|
|
| 1 |
-
# Use Python 3.9 as the base image
|
| 2 |
-
FROM python:3.9
|
| 3 |
|
| 4 |
-
# Create a user named 'user'
|
| 5 |
-
RUN useradd -m -u 1000 user
|
| 6 |
|
| 7 |
-
# Switch to the 'user' user for subsequent commands
|
| 8 |
-
USER user
|
| 9 |
|
| 10 |
-
# Add user's local bin directory to the PATH environment variable
|
| 11 |
-
ENV PATH="/home/user/.local/bin:$PATH"
|
| 12 |
|
| 13 |
-
# Set the working directory inside the container
|
| 14 |
-
WORKDIR /app
|
| 15 |
|
| 16 |
-
# Copy requirements.txt from the host to the container
|
| 17 |
-
COPY --chown=user ./requirements.txt requirements.txt
|
| 18 |
|
| 19 |
-
# Install Python dependencies listed in requirements.txt
|
| 20 |
-
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 21 |
|
| 22 |
-
# Copy the rest of the application code from the host to the container
|
| 23 |
-
COPY --chown=user . /app
|
| 24 |
|
| 25 |
-
# Specify the command to run the
|
| 26 |
-
CMD ["
|
|
|
|
| 1 |
+
# Use Python 3.9 as the base image
|
| 2 |
+
FROM python:3.9
|
| 3 |
|
| 4 |
+
# Create a user named 'user' and create its home directory
|
| 5 |
+
RUN useradd -m -u 1000 user
|
| 6 |
|
| 7 |
+
# Switch to the 'user' user for subsequent commands
|
| 8 |
+
USER user
|
| 9 |
|
| 10 |
+
# Add user's local bin directory to the PATH environment variable
|
| 11 |
+
ENV PATH="/home/user/.local/bin:$PATH"
|
| 12 |
|
| 13 |
+
# Set the working directory inside the container
|
| 14 |
+
WORKDIR /app
|
| 15 |
|
| 16 |
+
# Copy requirements.txt from the host to the container
|
| 17 |
+
COPY --chown=user ./requirements.txt requirements.txt
|
| 18 |
|
| 19 |
+
# Install Python dependencies listed in requirements.txt
|
| 20 |
+
RUN pip install --no-cache-dir --upgrade -r requirements.txt
|
| 21 |
|
| 22 |
+
# Copy the rest of the application code from the host to the container
|
| 23 |
+
COPY --chown=user . /app
|
| 24 |
|
| 25 |
+
# Specify the command to run the Panel app with appropriate arguments
|
| 26 |
+
CMD ["panel", "serve", "app.py", "--address", "0.0.0.0", "--port", "7860", "--allow-websocket-origin=*"]
|