File size: 1,443 Bytes
e918aee
 
 
 
 
 
d621767
 
 
 
e918aee
d12856e
d621767
e918aee
 
 
 
205413c
7e496b6
 
 
205413c
578b7de
 
 
33266d5
98fdf99
205413c
e918aee
 
a8e2fc2
e918aee
925747f
d621767
 
 
 
e918aee
 
 
d621767
59848b6
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# Use a lightweight Python runtime as a parent image
FROM python:3.10-slim

# Set environment variables to prevent Python from writing pyc files to disk and buffering stdout/stderr
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1

# Set the working directory in the container
WORKDIR /app

# Copy only the requirements file to leverage Docker cache
COPY requirements.txt /app/requirements.txt

# Install dependencies
RUN python -m pip install --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt && \
    python -m spacy download en_core_web_md
# Create the cache directory and set permissions
RUN mkdir -p /.cache && \
    chmod -R 777 /.cache 

RUN mkdir -p /app/.cache && \
    chmod -R 777 /app && \
    chmod -R 777 /app/.cache
ENV TRANSFORMERS_CACHE=/app/.cache
ENV HF_HOME=/app/.cache
ENV CHROMA_CACHE_DIR=/app/.cache
    # Copy the rest of the application code
COPY app.py /app/app.py
COPY webchat.py /app/webchat.py
COPY utils.py /app/utils.py
COPY .streamlit/config.toml /app/.streamlit/config.toml
COPY styles.css /app/styles.css

# Expose port 8501 for Streamlit
EXPOSE 8501

# Health check to ensure the container is healthy
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s CMD curl -f http://localhost:8501/_stcore/health || exit 1

# Run the application
#ENTRYPOINT ["streamlit", "run", "app.py", "--server.port", "8501", "--server.address", "0.0.0.0"]
ENTRYPOINT ["streamlit", "run", "app.py"]