Spaces:
Sleeping
Sleeping
circulartext
commited on
Commit
•
18e8ec4
1
Parent(s):
73593ca
Create Dockerfile
Browse files- Dockerfile +27 -0
Dockerfile
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# Use a suitable base Docker image with necessary dependencies
|
2 |
+
FROM circulartextapp/spaceread
|
3 |
+
|
4 |
+
# Set the working directory to /app
|
5 |
+
WORKDIR /app
|
6 |
+
|
7 |
+
# Copy the current directory contents into the container at /app
|
8 |
+
COPY . /app
|
9 |
+
|
10 |
+
# Install gosu (adjust the package manager based on your base image)
|
11 |
+
RUN apt-get update && apt-get install -y gosu && rm -rf /var/lib/apt/lists/*
|
12 |
+
|
13 |
+
# Set the entrypoint script as executable
|
14 |
+
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
15 |
+
RUN chmod +x /usr/local/bin/entrypoint.sh
|
16 |
+
|
17 |
+
# Set appropriate permissions for the application directory
|
18 |
+
RUN chown -R appuser:appuser /app && chmod -R 755 /app
|
19 |
+
|
20 |
+
# Switch to the user for improved security
|
21 |
+
USER appuser
|
22 |
+
|
23 |
+
# Define the entrypoint script to handle user creation and application startup
|
24 |
+
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
25 |
+
|
26 |
+
# Default command to run if the user doesn't provide a command
|
27 |
+
CMD ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--reload"]
|