-
Notifications
You must be signed in to change notification settings - Fork 188
Expand file tree
/
Copy pathdashboard.Dockerfile
More file actions
70 lines (51 loc) · 2.1 KB
/
Copy pathdashboard.Dockerfile
File metadata and controls
70 lines (51 loc) · 2.1 KB
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
FROM oven/bun:1.3.14-slim AS pruner
WORKDIR /app
COPY . .
RUN bunx turbo prune @databuddy/dashboard --docker
FROM oven/bun:1.3.14-slim AS builder
WORKDIR /app
COPY --from=pruner /app/out/json/ .
RUN bun install --ignore-scripts
COPY --from=pruner /app/out/full/ .
COPY --from=pruner /app/tsconfig ./tsconfig
COPY turbo.json turbo.json
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ENV SKIP_VALIDATION=true
# Build-time defaults keep the image buildable. Override these with real public
# URLs when building environment-specific dashboard images.
ARG NEXT_PUBLIC_API_URL=https://api.databuddy.cc
ARG NEXT_PUBLIC_APP_URL=https://app.databuddy.cc
ARG NEXT_PUBLIC_BASKET_URL=https://basket.databuddy.cc
ARG NEXT_PUBLIC_STATUS_URL=https://status.databuddy.cc
ENV NEXT_PUBLIC_API_URL=$NEXT_PUBLIC_API_URL
ENV NEXT_PUBLIC_APP_URL=$NEXT_PUBLIC_APP_URL
ENV NEXT_PUBLIC_BASKET_URL=$NEXT_PUBLIC_BASKET_URL
ENV NEXT_PUBLIC_STATUS_URL=$NEXT_PUBLIC_STATUS_URL
ENV API_URL=$NEXT_PUBLIC_API_URL
ENV BASKET_URL=$NEXT_PUBLIC_BASKET_URL
ENV DASHBOARD_URL=$NEXT_PUBLIC_APP_URL
ENV STATUS_URL=$NEXT_PUBLIC_STATUS_URL
RUN DATABASE_URL=postgres://databuddy:databuddy@localhost:5432/databuddy \
REDIS_URL=redis://localhost:6379 \
BULLMQ_REDIS_URL=redis://localhost:6379 \
CLICKHOUSE_URL=http://default:@localhost:8123/databuddy_analytics \
BETTER_AUTH_URL=$NEXT_PUBLIC_APP_URL \
BETTER_AUTH_SECRET=build-time-placeholder-secret \
RESEND_API_KEY=build-time-placeholder \
AUTUMN_SECRET_KEY=build-time-placeholder \
bunx turbo run build --filter=@databuddy/dashboard...
FROM node:22-slim AS runner
WORKDIR /app
ENV NODE_ENV=production
ENV NEXT_TELEMETRY_DISABLED=1
ENV HOSTNAME=0.0.0.0
ENV PORT=3000
RUN groupadd --system --gid 1001 nodejs \
&& useradd --system --uid 1001 --gid nodejs nextjs
COPY --from=builder --chown=nextjs:nodejs /app/apps/dashboard/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/apps/dashboard/.next/static ./apps/dashboard/.next/static
COPY --from=builder --chown=nextjs:nodejs /app/apps/dashboard/public ./apps/dashboard/public
USER nextjs
EXPOSE 3000
CMD ["node", "apps/dashboard/server.js"]