Spaces:
Paused
Paused
File size: 606 Bytes
d5b6fd5 0e7df75 d5b6fd5 0e7df75 d5b6fd5 8259ea8 0e7df75 d5b6fd5 0e7df75 d5b6fd5 0e7df75 d5b6fd5 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | FROM node:20-alpine AS webbuild
WORKDIR /app/web
COPY web/package.json ./
RUN npm install
COPY web ./
RUN npm run build
FROM node:20-alpine
RUN apk add --no-cache python3 make g++
WORKDIR /app/server
COPY server/package.json ./
RUN npm install --omit=dev
COPY server ./
COPY --from=webbuild /app/web/dist /app/web/dist
# HF Spaces runs the container as a non-root user (UID 1000):
# pre-create the data dir and hand the tree over so SQLite can write there.
RUN mkdir -p /app/server/data && chown -R 1000:1000 /app/server
ENV NODE_ENV=production PORT=8080
EXPOSE 8080
USER 1000
CMD ["node", "src/index.js"] |