Update Dockerfile
Browse files- Dockerfile +8 -7
Dockerfile
CHANGED
|
@@ -1,28 +1,29 @@
|
|
| 1 |
FROM node:20-alpine AS builder
|
| 2 |
|
| 3 |
-
#
|
| 4 |
RUN apk add --no-cache git && \
|
| 5 |
-
git clone https://github.com/
|
| 6 |
|
| 7 |
WORKDIR /app
|
| 8 |
|
| 9 |
-
# Install dependencies and
|
| 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
|
| 18 |
|
| 19 |
-
# Copy
|
| 20 |
COPY --from=builder /app/dist ./dist
|
| 21 |
|
| 22 |
-
#
|
| 23 |
RUN chmod -R 777 /app
|
| 24 |
|
| 25 |
EXPOSE 7860
|
| 26 |
|
| 27 |
-
#
|
| 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"]
|