OutageOdyssey / Dockerfile
kshitijthakkar
Docker file fix
cb569c6
raw
history blame contribute delete
968 Bytes
# 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"