File size: 889 Bytes
08080e4
543d258
 
 
832a62a
ad7b872
08080e4
832a62a
08080e4
543d258
39962fc
08080e4
543d258
39962fc
 
 
543d258
ad7b872
 
 
39962fc
 
 
 
 
832a62a
08080e4
 
 
543d258
39962fc
08080e4
 
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
FROM python:3.11-slim

WORKDIR /app

# 1. Install System Dependencies
# default-jdk-headless ensures we get a compatible Java version (likely 17 or 21)
RUN apt-get update && \
    apt-get install -y default-jdk-headless build-essential git && \
    rm -rf /var/lib/apt/lists/*

# 2. Copy files
COPY . .

# 3. Install Python libraries
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir -r requirements.txt

# 4. Create User (Fixed for 'dash' shell)
# Changed '&>/dev/null' to '>/dev/null 2>&1' to match the system shell
RUN id -u user >/dev/null 2>&1 || useradd -m -u 1000 user

# 5. Fix Permissions
RUN chown -R user:user /app && \
    chown -R user:user /home/user

# 6. Switch User
USER user
ENV HOME=/home/user \
    PATH=/home/user/.local/bin:$PATH

# 7. Run
EXPOSE 7860
CMD ["streamlit", "run", "app.py", "--server.port=7860", "--server.address=0.0.0.0"]