File size: 1,069 Bytes
f87af42
16b3c81
44dd441
e5132b5
 
 
 
f87af42
 
f79e9d6
 
 
f87af42
 
 
 
ab955a3
f79e9d6
ab955a3
f87af42
 
 
e5132b5
f87af42
 
e5132b5
f87af42
f79e9d6
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
# Use a suitable base Docker image with necessary dependencies
FROM circulartextapp/readspaceout

# Set the working directory to /app
WORKDIR /app

# Copy the current directory contents into the container at /app
COPY . /app

# Copy user and group information from the base image
COPY --from=circulartextapp/readspaceout /etc/passwd /etc/passwd
COPY --from=circulartextapp/readspaceout /etc/group /etc/group

# 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 appropriate permissions for the application directory
RUN chown -R user:user /app && chmod -R 755 /app

# Set the entrypoint script as executable
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
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"]