CoolFace
Apppublic

circulartext/Speed_Read_AI

sourceHugging Facecc-by-nc-sa-4.0updated 2y agoView on Hugging Face
0likes
Dockerfile44 linesDownload Raw Back to root
1# Use a suitable base Docker image with necessary dependencies2FROM circulartextapp/speedreaddock3 4 5 6# Set the working directory to /app7WORKDIR /app8# Copy the current directory contents into the container at /app9COPY . /app10 11# Define the user ID in the environment variable USER_ID with a default value12ARG USER_ID=100013ENV USER_ID=$USER_ID14 15# Check if the user already exists16RUN if [ -z "$USER_ID" ]; then \17      echo "User ID not provided. Using the default user ID 1000."; \18      USER_ID=1000; \19    fi && \20    if id "$USER_ID" >/dev/null 2>&1; then \21      echo "User with ID $USER_ID already exists."; \22    else \23      useradd -m -u "$USER_ID" user; \24    fi25 26# Set appropriate permissions for the application directory27RUN chown -R user:user /app && chmod -R 755 /app28 29 30# Install gosu (adjust the package manager based on your base image)31RUN apt-get update && apt-get install -y gosu && rm -rf /var/lib/apt/lists/*32COPY entrypoint.sh /usr/local/bin/entrypoint.sh33RUN chmod +x /usr/local/bin/entrypoint.sh34 35# Switch to the user for improved security36USER user37 38# Define the entrypoint script to handle user creation and application startup39ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]40 41# Default command to run if the user doesn't provide a command42CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]43 44