Spaces:
Sleeping
Sleeping
# Use the official Python latest image | |
FROM python:latest | |
# Set up a new user named "user" with user ID 1000 | |
RUN useradd -m -u 1000 user | |
# Set the home to the user's home directory and add user's local bin to PATH | |
ENV HOME=/home/user \ | |
PATH=/home/user/.local/bin:$PATH | |
# Switch to the "user" user | |
USER user | |
# Create the app directory | |
WORKDIR $HOME/app | |
# Copy the application code and the requirements.txt file | |
COPY --chown=user . $HOME/app | |
# Install requirements.txt | |
RUN pip install --requirement requirements.txt | |
# Run Python | |
CMD ["python", "app.py"] |