Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +9 -9
Dockerfile
CHANGED
|
@@ -4,7 +4,6 @@ FROM python:3.9
|
|
| 4 |
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
| 7 |
-
# Install system dependencies
|
| 8 |
# Install system dependencies
|
| 9 |
RUN apt-get update && apt-get install -y \
|
| 10 |
glpk-utils \
|
|
@@ -16,8 +15,7 @@ COPY requirements.txt /app/requirements.txt
|
|
| 16 |
# Install Python dependencies
|
| 17 |
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
|
| 18 |
|
| 19 |
-
|
| 20 |
-
# User
|
| 21 |
RUN useradd -m -u 1000 user
|
| 22 |
USER user
|
| 23 |
ENV HOME /home/user
|
|
@@ -26,11 +24,13 @@ ENV PATH $HOME/.local/bin:$PATH
|
|
| 26 |
WORKDIR $HOME
|
| 27 |
RUN mkdir app
|
| 28 |
WORKDIR $HOME/app
|
| 29 |
-
COPY .
|
| 30 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 31 |
EXPOSE 8501
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
|
| 35 |
-
--server.enableXsrfProtection false \
|
| 36 |
-
--server.fileWatcherType none
|
|
|
|
| 4 |
# Set the working directory
|
| 5 |
WORKDIR /app
|
| 6 |
|
|
|
|
| 7 |
# Install system dependencies
|
| 8 |
RUN apt-get update && apt-get install -y \
|
| 9 |
glpk-utils \
|
|
|
|
| 15 |
# Install Python dependencies
|
| 16 |
RUN pip install --no-cache-dir --upgrade -r /app/requirements.txt
|
| 17 |
|
| 18 |
+
# Create a non-root user and set permissions
|
|
|
|
| 19 |
RUN useradd -m -u 1000 user
|
| 20 |
USER user
|
| 21 |
ENV HOME /home/user
|
|
|
|
| 24 |
WORKDIR $HOME
|
| 25 |
RUN mkdir app
|
| 26 |
WORKDIR $HOME/app
|
| 27 |
+
COPY . /app
|
| 28 |
|
| 29 |
+
# Verify GLPK installation
|
| 30 |
+
RUN glpsol --version
|
| 31 |
+
|
| 32 |
+
# Expose port for Streamlit
|
| 33 |
EXPOSE 8501
|
| 34 |
+
|
| 35 |
+
# Command to run the Streamlit application
|
| 36 |
+
CMD ["streamlit", "run", "app.py", "--server.headless", "true", "--server.enableCORS", "false", "--server.enableXsrfProtection", "false", "--server.fileWatcherType", "none"]
|
|
|
|
|
|