WaysAhead Global commited on
Commit
a2d96d9
·
verified ·
1 Parent(s): 169fa44

Update Dockerfile

Browse files

FROM python:3.9-slim

WORKDIR /app

RUN apt-get update && apt-get install -y \
build-essential \
curl \
git \
&& rm -rf /var/lib/apt/lists/*

# Set Streamlit cache dir to /tmp
ENV STREAMLIT_HOME=/tmp/.streamlit
ENV STREAMLIT_CONFIG_DIR=/tmp/.streamlit
ENV XDG_CONFIG_HOME=/tmp

# Install dependencies
COPY requirements.txt .
RUN pip3 install --no-cache-dir -r requirements.txt

# Copy Streamlit app code
COPY src/ . # make sure your app is inside src/streamlit_app.py

# Expose default Streamlit port
EXPOSE 8501

HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1

ENTRYPOINT ["streamlit", "run", "streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]

Files changed (1) hide show
  1. Dockerfile +0 -38
Dockerfile CHANGED
@@ -1,38 +0,0 @@
1
- FROM python:3.9-slim
2
-
3
- # Set working directory
4
- WORKDIR /app
5
-
6
- # Install dependencies and required packages
7
- RUN apt-get update && apt-get install -y \
8
- build-essential \
9
- curl \
10
- software-properties-common \
11
- git \
12
- libspatialindex-dev \
13
- && rm -rf /var/lib/apt/lists/*
14
-
15
- # Create necessary writeable directories
16
- RUN mkdir -p /app/.streamlit /root/.cache && chmod -R 777 /app /root/.cache
17
-
18
- # Set environment variables to avoid permission issues
19
- ENV STREAMLIT_HOME=/app/.streamlit \
20
- OSMNX_CACHE_FOLDER=/root/.cache/osmnx \
21
- MPLCONFIGDIR=/root/.cache/matplotlib \
22
- PYTHONUNBUFFERED=1
23
-
24
- # Copy project files
25
- COPY requirements.txt ./
26
- COPY src/ ./src/
27
-
28
- # Install Python dependencies
29
- RUN pip3 install --upgrade pip && pip3 install -r requirements.txt
30
-
31
- # Expose default Streamlit port
32
- EXPOSE 8501
33
-
34
- # Health check for container monitoring
35
- HEALTHCHECK CMD curl --fail http://localhost:8501/_stcore/health || exit 1
36
-
37
- # Start the Streamlit app
38
- ENTRYPOINT ["streamlit", "run", "src/streamlit_app.py", "--server.port=8501", "--server.address=0.0.0.0"]