l
File size: 1,357 Bytes
c089ca4
 
507ab41
c089ca4
507ab41
 
c089ca4
507ab41
 
 
c089ca4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
507ab41
c089ca4
 
 
 
 
507ab41
c089ca4
507ab41
 
c089ca4
 
507ab41
c089ca4
 
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
45
46
47
# Use Python 3.11 slim as base image for the NZ Legislation Loophole Analysis Streamlit App
FROM python:3.11-slim

# Install system dependencies required for llama-cpp-python compilation and general app functionality
RUN apt-get update && apt-get install -y \
    build-essential \
    cmake \
    git \
    && rm -rf /var/lib/apt/lists/*

# Set working directory
WORKDIR /app

# Copy requirements file and install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

# Copy the entire Streamlit application
COPY streamlit_app/ ./streamlit_app/

# Copy data files (if needed for testing or default data)
COPY nz-legislation.txt ./

# Create necessary directories for the Streamlit app
RUN mkdir -p \
    streamlit_app/cache \
    streamlit_app/config \
    streamlit_app/datasets \
    streamlit_app/logs \
    streamlit_app/uploads \
    nz_legislation_dataset

# Set environment variables for Streamlit
ENV STREAMLIT_SERVER_HEADLESS=true
ENV STREAMLIT_BROWSER_GATHER_USAGE_STATS=false
ENV STREAMLIT_SERVER_PORT=8501
ENV STREAMLIT_SERVER_ADDRESS=0.0.0.0

# Expose the Streamlit port
EXPOSE 8501

# Set working directory to the Streamlit app
WORKDIR /app/streamlit_app

# Set the default command to run the Streamlit application
CMD ["streamlit", "run", "app.py", "--server.port=8501", "--server.address=0.0.0.0"]