-
Notifications
You must be signed in to change notification settings - Fork 10
/
Dockerfile.api
55 lines (35 loc) · 1.36 KB
/
Dockerfile.api
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
# Install dependencies only when needed
FROM node:18-alpine AS builder
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
# COPY . .
RUN npm install -g pnpm
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml turbo.json .npmrc ./
# RUN pnpm fetch --prod
COPY api/package.json api/
COPY web/package.json web/
COPY packages/core/package.json packages/core/
COPY packages/client/package.json packages/client/
COPY packages/api-types/package.json packages/api-types/
COPY packages/bridge/package.json packages/bridge/
COPY packages/punycode/package.json packages/punycode/
COPY web/patches web/patches
RUN CI=true pnpm install --frozen-lockfile --shamefully-hoist
COPY . .
RUN pnpm --filter @bns-x/api prebuild
RUN pnpm build:packages
COPY api/scripts/docker-entrypoint.sh docker-entrypoint.sh
RUN chmod 755 docker-entrypoint.sh
EXPOSE 8080
CMD ["/bin/sh", "docker-entrypoint.sh"]
# Production image, copy all the files and run
# FROM node:18-alpine AS runner
# WORKDIR /app
# ENV NODE_ENV production
# RUN npm install -g pnpm
# COPY --from=builder /app ./
# # COPY api/scripts/docker-entrypoint.sh /docker-entrypoint.sh
# RUN chmod 755 api/scripts/docker-entrypoint.sh
# EXPOSE 8080
# CMD api/scripts/docker-entrypoint.sh