Spaces:
Sleeping
Sleeping
Create Dockerfile
Browse files- Dockerfile +26 -0
Dockerfile
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use an official Python runtime as a parent image
|
2 |
+
FROM python:3.9-slim
|
3 |
+
|
4 |
+
# Set the working directory in the container
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Copy the requirements file into the container at /app
|
8 |
+
COPY requirements.txt .
|
9 |
+
|
10 |
+
# Install any needed packages specified in requirements.txt
|
11 |
+
# Using --no-cache-dir to reduce image size
|
12 |
+
RUN pip install --no-cache-dir -r requirements.txt
|
13 |
+
|
14 |
+
# Copy the rest of the application's code into the container at /app
|
15 |
+
COPY . .
|
16 |
+
|
17 |
+
# Make port 8501 available to the world outside this container
|
18 |
+
EXPOSE 8501
|
19 |
+
|
20 |
+
# Define environment variable
|
21 |
+
ENV STREAMLIT_SERVER_PORT 8501
|
22 |
+
ENV STREAMLIT_SERVER_HEADLESS true
|
23 |
+
|
24 |
+
# Run app.py when the container launches
|
25 |
+
# Use the 'streamlit run' command with appropriate flags
|
26 |
+
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]
|