chizk commited on
Commit
c475e3d
·
verified ·
1 Parent(s): c8132c7

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +8 -7
Dockerfile CHANGED
@@ -1,28 +1,29 @@
1
  FROM node:20-alpine AS builder
2
 
3
- # Clone ChatLima directly from source
4
  RUN apk add --no-cache git && \
5
- git clone https://github.com/milenatb/chatlima.git /app
6
 
7
  WORKDIR /app
8
 
9
- # Install dependencies and compile the production client build
10
  RUN npm install -g pnpm && \
11
  pnpm install && \
12
  pnpm run build
13
 
 
14
  FROM node:20-alpine AS runner
15
  WORKDIR /app
16
 
17
- RUN npm install -g pnpm static-server
18
 
19
- # Copy compiled web files from the build layer
20
  COPY --from=builder /app/dist ./dist
21
 
22
- # Hugging Face runs as user 1000, ensure access to target files
23
  RUN chmod -R 777 /app
24
 
25
  EXPOSE 7860
26
 
27
- # Serve the static build directly onto port 7860 for Hugging Face
28
  CMD ["static-server", "-p", "7860", "-d", "./dist", "--host", "0.0.0.0"]
 
1
  FROM node:20-alpine AS builder
2
 
3
+ # Install git, clone the correct upstream repository, and switch to it
4
  RUN apk add --no-cache git && \
5
+ git clone https://github.com/brooksy4503/chatlima.git /app
6
 
7
  WORKDIR /app
8
 
9
+ # Install dependencies and build static assets
10
  RUN npm install -g pnpm && \
11
  pnpm install && \
12
  pnpm run build
13
 
14
+ # Light-weight server step to host static files on Hugging Face
15
  FROM node:20-alpine AS runner
16
  WORKDIR /app
17
 
18
+ RUN npm install -g static-server
19
 
20
+ # Copy build folder from previous stage
21
  COPY --from=builder /app/dist ./dist
22
 
23
+ # Give wide-open directory permissions for HF's random UIDs
24
  RUN chmod -R 777 /app
25
 
26
  EXPOSE 7860
27
 
28
+ # Execute server bound to all interfaces on port 7860
29
  CMD ["static-server", "-p", "7860", "-d", "./dist", "--host", "0.0.0.0"]