-
Notifications
You must be signed in to change notification settings - Fork 63
/
Dockerfile
46 lines (30 loc) · 991 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# Debian based node 21.6 image
FROM node:21.6-bookworm as development
LABEL maintainer="Langtrace AI <contact@langtrace.ai>"
LABEL version="1.0"
LABEL description="Open source observability for your LLM applications."
LABEL url="https://langtrace.ai/"
LABEL vendor="Scale3Labs"
LABEL license="AGPL"
WORKDIR /app
COPY . .
RUN npm install
EXPOSE 3000
CMD [ "/bin/sh", "-c", "npm run dev" ]
# Intermediate image for building the application
FROM development as builder
WORKDIR /app
RUN NEXT_PUBLIC_ENABLE_ADMIN_LOGIN=true npm run build
# Final release image
FROM node:21.6-bookworm as production
WORKDIR /app
# Copy only the necessary files
COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/package.json .
COPY --from=builder /app/public ./public
COPY --from=builder /app/scripts ./scripts
# Install only production dependencies
RUN npm install --only=production --omit=dev
CMD [ "/bin/sh", "-c", "npm start" ]
EXPOSE 3000