forked from promptfoo/promptfoo
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
32 lines (21 loc) · 717 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
# https://github.com/vercel/next.js/blob/canary/examples/with-docker/Dockerfile
# ---- Build ----
FROM node:16-alpine AS builder
ENV NEXT_PUBLIC_PROMPTFOO_BUILD_STANDALONE_SERVER=1
WORKDIR /app
COPY . .
# Envars are read in from src/web/nextui/.env.production
RUN echo "*** Building with env vars from .env.production"
RUN npm install
WORKDIR /app/src/web/nextui
RUN npm prune --production
# ---- Final Stage ----
FROM node:16-alpine
WORKDIR /app
COPY --from=builder /app/src/web/nextui/public ./public
COPY --from=builder /app/src/web/nextui/.next/standalone ./
COPY --from=builder /app/src/web/nextui/.next/static ./.next/static
EXPOSE 3000
ENV PORT 3000
ENV HOSTNAME "0.0.0.0"
CMD ["node", "server.js"]