forked from databuddy-analytics/Databuddy
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdashboard.Dockerfile
More file actions
52 lines (41 loc) · 1.13 KB
/
dashboard.Dockerfile
File metadata and controls
52 lines (41 loc) · 1.13 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
# Build stage
FROM oven/bun:1-slim AS builder
# Copy dependency files
COPY package.json bun.lock turbo.json /build/
COPY apps/dashboard /build/apps/dashboard
COPY packages/ /build/packages
WORKDIR /build
# Install dependencies
RUN bun install
WORKDIR /build/packages/sdk
RUN bun run build
# build dashboard
WORKDIR /build/apps/dashboard
ENV NODE_ENV=production
ENV REDIS_URL=redis://localhost
ENV DATABASE_URL=postgres://localhost
ENV CLICKHOUSE_URL=https://localhost
ENV NEXT_PUBLIC_API_URL=https://localhost
ENV PORT=3000
ENV BUN_ENV=production
RUN bun install
RUN bun run build
# Production stage
FROM oven/bun:1-slim
# Copy built files from builder
WORKDIR /app
COPY --from=builder /build/node_modules ./node_modules
COPY --from=builder /build/apps/dashboard ./apps/dashboard
COPY --from=builder /build/packages ./packages
# Set environment variables
ENV NODE_ENV=production
ENV REDIS_URL=redis://localhost
ENV DATABASE_URL=postgres://localhost
ENV CLICKHOUSE_URL=https://localhost
ENV NEXT_PUBLIC_API_URL=https://localhost
ENV HOSTNAME=0.0.0.0
# Expose port
EXPOSE 3000
WORKDIR /app/apps/dashboard
# Start API
CMD ["bun", "run", "start"]