kshitijthakkar
removed run.sh deps
4ea319e
raw
history blame
884 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
EXPOSE 8000 7860
# Run the startup script
CMD bash -c "python /app/enhanced_app.py"