forked from ethereum-optimism/actions
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile
More file actions
47 lines (32 loc) · 1.17 KB
/
Dockerfile
File metadata and controls
47 lines (32 loc) · 1.17 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
FROM node:18-alpine AS base
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
COPY package.json ./
RUN npm install -g corepack@0.32.0
RUN corepack enable
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
## provide a path for extra certs to be injected into the container
ENV NODE_EXTRA_CA_CERTS=/usr/local/share/ca-certificates/extra-ca-certificates.crt
########################################################
# STAGE 1: Monorepo Builder
########################################################
FROM base AS builder
WORKDIR /usr/src/app
RUN apk add --no-cache python3 make g++
COPY ../pnpm-lock.yaml ./
RUN pnpm fetch
COPY . ./
RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --frozen-lockfile --prefer-offline
# provide the ability to build a single projects
ARG DOCKER_TARGET
RUN pnpm nx build @eth-optimism/actions-service
RUN pnpm deploy --filter @eth-optimism/actions-service --prod /prod/actions-service
########################################################
# STAGE 2: Image
########################################################
FROM base AS actions-service
WORKDIR /usr/src/app
COPY --from=builder /prod/actions-service ./
EXPOSE 3000
ENTRYPOINT ["pnpm"]
CMD ["start"]