Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +14 -15
Dockerfile
CHANGED
|
@@ -1,28 +1,27 @@
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
-
|
|
|
|
| 4 |
|
| 5 |
-
#
|
| 6 |
-
|
| 7 |
|
| 8 |
-
#
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
libtesseract-dev \
|
| 12 |
-
&& rm -rf /var/lib/apt/lists/*
|
| 13 |
|
| 14 |
-
#
|
|
|
|
| 15 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
-
#
|
| 18 |
-
|
| 19 |
|
| 20 |
-
#
|
| 21 |
-
|
| 22 |
-
USER myuser
|
| 23 |
|
| 24 |
# Expose port 7860
|
| 25 |
EXPOSE 7860
|
| 26 |
|
| 27 |
# Run the app
|
| 28 |
-
CMD ["chainlit", "run", "app.py", "--port", "7860"]
|
|
|
|
| 1 |
FROM python:3.9-slim
|
| 2 |
|
| 3 |
+
# Create a non-root user
|
| 4 |
+
RUN useradd -m -u 1000 user
|
| 5 |
|
| 6 |
+
# Set the working directory
|
| 7 |
+
WORKDIR /home/user/app
|
| 8 |
|
| 9 |
+
# Set environment variables
|
| 10 |
+
ENV HOME=/home/user
|
| 11 |
+
ENV PATH=/home/user/.local/bin:$PATH
|
|
|
|
|
|
|
| 12 |
|
| 13 |
+
# Copy requirements.txt and install dependencies
|
| 14 |
+
COPY --chown=user:user requirements.txt /home/user/app/requirements.txt
|
| 15 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 16 |
|
| 17 |
+
# Copy the rest of the application code
|
| 18 |
+
COPY --chown=user:user . /home/user/app
|
| 19 |
|
| 20 |
+
# Switch to the non-root user
|
| 21 |
+
USER user
|
|
|
|
| 22 |
|
| 23 |
# Expose port 7860
|
| 24 |
EXPOSE 7860
|
| 25 |
|
| 26 |
# Run the app
|
| 27 |
+
CMD ["chainlit", "run", "app.py", "--port", "7860"]
|