Spaces:
Paused
Paused
Create Dockerfile
Browse files- Dockerfile +19 -0
Dockerfile
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 1. Start from the base image as before
|
| 2 |
+
FROM ghcr.io/parasshah10/grok2api:latest
|
| 3 |
+
|
| 4 |
+
# 2. Create a non-root user (named 'user' with UID 1000).
|
| 5 |
+
# Then, create the directories the app needs to write to (/app/logs and /app/data).
|
| 6 |
+
# Finally, change the ownership of the entire /app directory to this new user.
|
| 7 |
+
RUN useradd -m -u 1000 user && \
|
| 8 |
+
mkdir -p /app/logs /app/data && \
|
| 9 |
+
chown -R 1000:1000 /app
|
| 10 |
+
|
| 11 |
+
# 3. Switch to the newly created non-root user.
|
| 12 |
+
# All subsequent commands will be run by 'user', who now has write access to /app.
|
| 13 |
+
USER user
|
| 14 |
+
|
| 15 |
+
# 4. Expose the port as before.
|
| 16 |
+
EXPOSE 8000
|
| 17 |
+
|
| 18 |
+
# The CMD is inherited from the base image, so we don't need to specify it again.
|
| 19 |
+
# The base image already knows how to start the uvicorn server.
|