Spaces:
Sleeping
Sleeping
Commit ·
d516448
1
Parent(s): 7aef42c
Create Dockerfile
Browse files123456789101112131415161718192021222324252627282930# Use a suitable base Docker image with necessary dependenciesFROM circulartextapp/readspaceout
# Set the working directory to /appWORKDIR /app
# Copy the current directory contents into the container at /appCOPY . /app
# Copy user and group information from the base imageCOPY --from=circulartextapp/readspaceout /etc/passwd /etc/passwdCOPY --from=circulartextapp/readspaceout /etc/group /etc/group
# Set appropriate permissions for the application directory using UID and GIDRUN if getent passwd user > /dev/null 2>&1 && getent group user > /dev/null 2>&1; then \ chown -R "$USER_ID":"$USER_GROUP" /app && chmod -R 755 /app; \ fi
# Install gosu (adjust the package manager based on your base image)RUN apt-get update && apt-get install -y gosu && rm -rf /var/lib/apt/lists/*
# Set the entrypoint script as executableCOPY entrypoint.sh /usr/local/bin/entrypoint.shRUN chmod +x /usr/local/bin/entrypoint.sh
# Define the entrypoint script to handle user creation and application startupENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
# Default command to run if the user doesn't provide a commandCMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]DockerfileAdded+30