Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +11 -3
Dockerfile
CHANGED
|
@@ -1,11 +1,19 @@
|
|
| 1 |
FROM stephengpope/no-code-architects-toolkit:latest
|
| 2 |
|
| 3 |
# Set up user for Hugging Face Spaces compatibility
|
| 4 |
-
|
| 5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
# Create data directory for persistence if using Hugging Face Spaces persistent storage
|
|
|
|
|
|
|
| 8 |
RUN mkdir -p /data
|
|
|
|
| 9 |
|
| 10 |
# Default environment variables
|
| 11 |
ENV API_KEY=your_api_key \
|
|
@@ -14,7 +22,7 @@ ENV API_KEY=your_api_key \
|
|
| 14 |
GUNICORN_WORKERS=4 \
|
| 15 |
GUNICORN_TIMEOUT=300
|
| 16 |
|
| 17 |
-
# Expose the port that the API will run on
|
| 18 |
EXPOSE 8080
|
| 19 |
|
| 20 |
# The container will start automatically with the CMD from the base image
|
|
|
|
| 1 |
FROM stephengpope/no-code-architects-toolkit:latest
|
| 2 |
|
| 3 |
# Set up user for Hugging Face Spaces compatibility
|
| 4 |
+
RUN useradd -m -u 1000 user # Uncommented to create the user
|
| 5 |
+
USER user # Switch to the created user
|
| 6 |
+
|
| 7 |
+
ENV HOME=/home/user \
|
| 8 |
+
PATH=/home/user/.local/bin:$PATH
|
| 9 |
+
|
| 10 |
+
WORKDIR $HOME/app
|
| 11 |
|
| 12 |
# Create data directory for persistence if using Hugging Face Spaces persistent storage
|
| 13 |
+
# This directory is owned by root initially, ensure user has write access if needed at runtime
|
| 14 |
+
# Or adjust permissions if build-time access is required (though /data is runtime only)
|
| 15 |
RUN mkdir -p /data
|
| 16 |
+
# If runtime write issues occur, consider adding: RUN chown user:user /data
|
| 17 |
|
| 18 |
# Default environment variables
|
| 19 |
ENV API_KEY=your_api_key \
|
|
|
|
| 22 |
GUNICORN_WORKERS=4 \
|
| 23 |
GUNICORN_TIMEOUT=300
|
| 24 |
|
| 25 |
+
# Expose the port that the API will run on (ensure this matches README.md app_port)
|
| 26 |
EXPOSE 8080
|
| 27 |
|
| 28 |
# The container will start automatically with the CMD from the base image
|