-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.web
46 lines (34 loc) · 1015 Bytes
/
Dockerfile.web
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
FROM node:20 AS base
# Install all npm deps
FROM base AS deps
WORKDIR /app
COPY package*.json ./
COPY apps/web/package*.json ./apps/web/
COPY packages/client/package*.json ./packages/client/
COPY packages/core/package*.json ./packages/core/
COPY packages/db/package*.json ./packages/db/
COPY packages/cube/package*.json ./packages/cube/
RUN npm ci
# Install all internal deps
FROM deps AS internal_deps
WORKDIR /app
COPY packages ./packages
COPY apps/web ./apps/web
RUN npm ci
RUN npm run generate -w @ecosync/db
# Build web app
FROM internal_deps AS builder
WORKDIR /app
RUN npm run build -w @ecosync/web
# Copy necessary content and run app
FROM base AS runner
WORKDIR /app
COPY --from=builder /app/package.json .
COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/apps/web ./packages/web
COPY --from=builder /app/packages/db ./packages/db
ENV NODE_ENV production
ENV PORT 3000
ENV DATABASE_URL postgresql://user:password@db/ecosync
EXPOSE 3000
CMD npm start -w @ecosync/web