Spaces:
Sleeping
Sleeping
Upload 2 files
Browse files- Dockerfile +20 -0
- env +3 -0
Dockerfile
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# 1. Pull the official image used in the docker-compose.yml
|
| 2 |
+
FROM ghcr.io/tashfeenahmed/freellmapi:latest
|
| 3 |
+
|
| 4 |
+
# 2. Hugging Face requires apps to bind to 0.0.0.0 and listen on port 7860
|
| 5 |
+
ENV NODE_ENV=production
|
| 6 |
+
ENV HOST_BIND=0.0.0.0
|
| 7 |
+
ENV PORT=7860
|
| 8 |
+
|
| 9 |
+
# 3. Hugging Face runs containers as a non-root user (uid 1000).
|
| 10 |
+
# We need to create the volume directory and grant the correct permissions so the app doesn't crash.
|
| 11 |
+
USER root
|
| 12 |
+
RUN mkdir -p /app/server/data && \
|
| 13 |
+
chown -R 1000:1000 /app/server/data && \
|
| 14 |
+
chmod -R 777 /app/server/data
|
| 15 |
+
|
| 16 |
+
# Switch back to the required non-root user
|
| 17 |
+
USER 1000
|
| 18 |
+
|
| 19 |
+
# 4. Expose the Hugging Face port
|
| 20 |
+
EXPOSE 7860
|
env
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
PORT=7860
|
| 2 |
+
HOST=0.0.0.0
|
| 3 |
+
NODE_ENV=production
|