File size: 1,011 Bytes
1a4f599
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
# Dockerfile for a Python application with user permissions
FROM python:3.11-slim

# Install system dependencies as root
RUN apt-get update && apt-get install -y build-essential && apt-get install -y curl && rm -rf /var/lib/apt/lists/*

# Create user and set up directory structure as root
RUN useradd -m -u 1000 user && \
    mkdir -p /app && \
    chown -R user:user /app

# Set working directory
WORKDIR /app

# Switch to user AFTER setting up permissions
USER user
ENV PATH="/home/user/.local/bin:$PATH"

# Copy files with proper ownership
COPY --chown=user:user . /app

# Install Python dependencies
COPY --chown=user:user ./requirements.txt requirements.txt
RUN pip install --no-cache-dir --upgrade pip && \
    pip install --no-cache-dir --user -r requirements.txt

# Make start.sh executable
RUN chmod +x run.sh
EXPOSE 8000 7860
# Run the startup script
#CMD ["sh", "-c", "bash run.sh"]
#CMD bash -c "python /app/mcp_server.py & sleep 60 && python /app/app.py"
CMD bash -c "python /app/enhanced_app.py"