Spaces:
Sleeping
Sleeping
Update Dockerfile
Browse files- Dockerfile +15 -8
Dockerfile
CHANGED
@@ -1,16 +1,23 @@
|
|
1 |
-
#
|
2 |
-
FROM python:3.9
|
3 |
|
|
|
4 |
WORKDIR /code
|
|
|
|
|
|
|
|
|
5 |
# Copy only requirements.txt initially to leverage Docker cache
|
6 |
-
COPY
|
7 |
|
|
|
8 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
9 |
|
10 |
-
|
|
|
11 |
|
12 |
-
|
13 |
-
|
14 |
|
15 |
-
# Command to run
|
16 |
-
CMD ["streamlit", "run", "app.py"]
|
|
|
1 |
+
# Use an appropriate base image
|
2 |
+
FROM python:3.9
|
3 |
|
4 |
+
# Set the working directory
|
5 |
WORKDIR /code
|
6 |
+
|
7 |
+
# Install system dependencies
|
8 |
+
RUN apt-get update && apt-get install -y glpk-utils
|
9 |
+
|
10 |
# Copy only requirements.txt initially to leverage Docker cache
|
11 |
+
COPY requirements.txt /code/requirements.txt
|
12 |
|
13 |
+
# Install Python dependencies
|
14 |
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
|
15 |
|
16 |
+
# Copy the rest of the application code
|
17 |
+
COPY . /code
|
18 |
|
19 |
+
# Expose the port Streamlit runs on (default is 8501)
|
20 |
+
EXPOSE 8501
|
21 |
|
22 |
+
# Command to run your Streamlit application
|
23 |
+
CMD ["streamlit", "run", "app.py", "--server.port", "8501", "--server.address", "0.0.0.0"]
|