Spaces:
Sleeping
Sleeping
File size: 756 Bytes
2b3128b cb13419 2b3128b 783a18e cb13419 2b3128b 783a18e 3d2ce10 783a18e 7edc646 783a18e 2b3128b 783a18e 2b3128b cb13419 2b3128b 783a18e |
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 |
# Use an official Python runtime as a parent image
FROM python:3.10-slim
# Install git and other necessary packages
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*
# Create a user with a non-root UID
RUN useradd -m -u 1000 user
# Set environment variables
ENV PATH="/home/user/.local/bin:$PATH"
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# Set the working directory and ensure it exists
WORKDIR /app
RUN chown user:user /app
# Copy the entrypoint script and set permissions
COPY entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh && chown user:user /entrypoint.sh
# Switch to the non-root user
USER user
# Expose the port your app runs on
EXPOSE 8080
# Define the entrypoint
ENTRYPOINT ["/entrypoint.sh"] |