Spaces:
Sleeping
Sleeping
File size: 501 Bytes
0daaf05 a7438ba 225dc8e eb2dd81 225dc8e 0465d18 12226bd 318c2a2 eb2dd81 12226bd eb2dd81 12226bd a7438ba f618b3b 12226bd |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# Use Python 3.9 slim image as the base
FROM python:3.9-slim
# Set the working directory
WORKDIR /code
# Create a non-root user and switch to it
RUN groupadd -r myuser && useradd -r -g myuser myuser
# Copy and install Python dependencies
COPY requirements.txt /code/requirements.txt
RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt
# Switch to the non-root user
USER myuser
# Copy application code
COPY . /code
# Default command to run the application
CMD ["python", "app.py"]
|