Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

Dockerfile 1.2 KB

You have to be logged in to leave a comment. Sign In
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
  1. FROM --platform=${BUILDPLATFORM} node:20-alpine
  2. FROM node:20-alpine AS base
  3. # Install dependencies only when needed
  4. FROM base AS builder
  5. # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
  6. RUN apk add --no-cache libc6-compat
  7. WORKDIR /app
  8. # Set environment variables for the build
  9. ENV VITE_IS_HOSTED=1 \
  10. VITE_TELEMETRY_DISABLED=1
  11. COPY . .
  12. RUN npm install --install-links --include=peer
  13. # Run npm install for the react app
  14. WORKDIR /app/src/app
  15. RUN npm install
  16. WORKDIR /app
  17. RUN npm run build
  18. FROM base AS server
  19. WORKDIR /app
  20. COPY --from=builder /app/node_modules ./node_modules
  21. COPY --from=builder /app/dist ./dist
  22. # Make Python version configurable with a default of 3.12
  23. ARG PYTHON_VERSION=3.12
  24. # Install Python for python providers, prompts, asserts, etc.
  25. RUN apk add --no-cache python3~=${PYTHON_VERSION} py3-pip py3-setuptools curl && \
  26. ln -sf python3 /usr/bin/python && \
  27. npm link promptfoo
  28. ENV API_PORT=3000
  29. ENV HOST=0.0.0.0
  30. EXPOSE 3000
  31. # Set up healthcheck
  32. HEALTHCHECK --interval=30s --timeout=10s --start-period=5s CMD curl -f http://localhost:3000/health || exit 1
  33. CMD ["node", "dist/src/server/index.js"]
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...