forked from OpenZeppelin/openzeppelin-relayer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.development
More file actions
60 lines (41 loc) · 1.35 KB
/
Dockerfile.development
File metadata and controls
60 lines (41 loc) · 1.35 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
53
54
55
56
57
58
59
60
# Base image
FROM --platform=${BUILDPLATFORM} cgr.dev/chainguard/rust:latest-dev@sha256:faf49718aaa95c798ed1dfdf3e4edee2cdbc3790c8994705ca6ef35972128459 AS base
USER root
RUN apk update && apk --no-cache add \
openssl-dev \
perl \
libsodium-dev
ENV PKG_CONFIG_PATH=/usr/lib/pkgconfig
WORKDIR /usr/app
# Copy
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/app/target \
cargo install --root /usr/app --path . --debug --locked
# Setting up build directories
FROM --platform=${BUILDPLATFORM} cgr.dev/chainguard/wolfi-base
WORKDIR /app
COPY --from=base --chown=nonroot:nonroot /usr/app/bin/openzeppelin-relayer /app/openzeppelin-relayer
# Install plugin dependencies
ARG TARGETARCH
ARG NODE_VERSION=20.19
# Install Node.js
USER root
RUN apk add --no-cache nodejs=~${NODE_VERSION} npm
ENV PATH="/usr/local/bin:$PATH"
# Install pnpm and ts-node
RUN npm install -g pnpm ts-node typescript
# removes apk and unneeded wolfi-base tools.
RUN apk del wolfi-base apk-tools
# Copy plugins folder and install dependencies
COPY --chown=nonroot:nonroot ./plugins /app/plugins
USER nonroot
WORKDIR /app/plugins
RUN pnpm install --frozen-lockfile
# Return to app root
WORKDIR /app
ENV APP_PORT=8080
ENV METRICS_PORT=8081
EXPOSE ${APP_PORT}/tcp ${METRICS_PORT}/tcp
# starting up
ENTRYPOINT ["/app/openzeppelin-relayer"]