File size: 643 Bytes
12a7166
66b83de
af7e0b2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# 1. Pull the official image used in the docker-compose.yml   update
FROM ghcr.io/tashfeenahmed/freellmapi:latest

# 2. Hugging Face requires apps to bind to 0.0.0.0 and listen on port 7860
ENV NODE_ENV=production
ENV HOST_BIND=0.0.0.0
ENV PORT=7860

# 3. Hugging Face runs containers as a non-root user (uid 1000). 
# We need to create the volume directory and grant the correct permissions so the app doesn't crash.
USER root
RUN mkdir -p /app/server/data && \
    chown -R 1000:1000 /app/server/data && \
    chmod -R 777 /app/server/data

# Switch back to the required non-root user
USER 1000

# 4. Expose the Hugging Face port
EXPOSE 7860