Alok2joshi commited on
Commit
af7e0b2
·
verified ·
1 Parent(s): 342458f

Upload 2 files

Browse files
Files changed (2) hide show
  1. Dockerfile +20 -0
  2. 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