Speed_Read_AI / Dockerfile
circulartext's picture
Update Dockerfile
c96a313
raw
history blame
1.07 kB
# Use a suitable base Docker image with necessary dependencies
FROM circulartextapp/spaceread
# Set the working directory to /app
WORKDIR /app
# Copy the current directory contents into the container at /app
COPY . /app
# 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/*
# Create the appuser
RUN adduser --disabled-password --gecos '' appuser
# Set appropriate permissions for the application directory
RUN chown -R appuser:appuser /app && chmod -R 755 /app
# Switch to the user for improved security
USER appuser
# Copy the entrypoint script into the container
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
# Make the entrypoint script executable
RUN chmod +x /usr/local/bin/entrypoint.sh
# Define the entrypoint script to handle user creation and application startup
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
# Default command to run if the user doesn't provide a command
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]