File size: 794 Bytes
5e25821 d40d06b |
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 |
FROM python:3.9
# Create a user with a specified UID to avoid permission issues
RUN useradd -m -u 1000 user
# Set the working directory to the user's home directory
WORKDIR /app
# Install system dependencies (sudo, npm) as root
# Copy package.json and package-lock.json to the working directory and set the owner to user
# Set the user for subsequent commands
COPY --chown=user ./main.py main.py
COPY --chown=user ./r.txt r.txt
# Install Node.js dependencies
RUN pip3 install -r r.txt
# Copy the rest of the application code to the working directory and set the owner to user
COPY --chown=user . /app
# Ensure the user has write permission to health_data.json
# Expose the port your app runs on
EXPOSE 7860
# Command to run your application
CMD gunicorn -w 4 -b 0.0.0.0:7860 main:app
|