-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
34 lines (29 loc) · 778 Bytes
/
Dockerfile
File metadata and controls
34 lines (29 loc) · 778 Bytes
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
FROM oven/bun:1 AS base
# Install dependencies
FROM base AS deps
WORKDIR /app
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
COPY api/package.json api/
COPY app/package.json app/
COPY web/package.json web/
RUN bun install
# Build React app
FROM deps AS build-app
WORKDIR /app
COPY app/ app/
ARG VITE_API_URL=https://api.ghwatch.live
ENV VITE_API_URL=$VITE_API_URL
RUN cd app && bun run build
# Production
FROM base AS runtime
WORKDIR /app
COPY --from=deps /app/node_modules node_modules
COPY --from=deps /app/api/node_modules api/node_modules
COPY --from=deps /app/web/node_modules web/node_modules
COPY api/ api/
COPY web/ web/
COPY --from=build-app /app/app/dist app/dist
ENV NODE_ENV=production
ENV PORT=8080
EXPOSE 8080
CMD ["bun", "run", "api/src/server.ts"]