File size: 827 Bytes
3b7f034
 
ec1c3da
3b7f034
 
 
 
ec1c3da
3b7f034
 
 
ec1c3da
b60a03f
 
 
 
ec1c3da
 
3b7f034
 
 
 
 
ec1c3da
 
 
 
 
3b7f034
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
FROM python:3.10-slim

# Install Java for language-tool-python
RUN apt-get update && \
    apt-get install -y openjdk-17-jre-headless curl && \
    apt-get clean && rm -rf /var/lib/apt/lists/*

# Set Java env
ENV JAVA_HOME="/usr/lib/jvm/java-17-openjdk-amd64"
ENV PATH="${JAVA_HOME}/bin:${PATH}"

# Environment variables for Streamlit and cache
ENV HOME=/app
ENV STREAMLIT_HOME=/app/.streamlit
ENV XDG_CACHE_HOME=/app/.cache

# Copy code and install dependencies
WORKDIR /app
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt

COPY . /app

# Ensure write permission for non-root user (user 1000)
RUN mkdir -p /app/.streamlit /app/.cache/language_tool_python && \
    chown -R 1000:1000 /app

# Run the Streamlit app
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.enableCORS=false"]