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
72 lines (52 loc) · 1.86 KB
/
Dockerfile.development
File metadata and controls
72 lines (52 loc) · 1.86 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
61
62
63
64
65
66
67
68
69
70
71
72
# Base image
# Rustc v1.91.1
# The digest needs to be updated everytime the minimum version is changed, and if the version is above 1.91.1
FROM cgr.dev/chainguard/rust:latest-dev@sha256:33faad9a26e8437ed9725bea3eb2d1e85facd1c035a31af8d485ea8c0a935532 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
# Optional: set to "redis-tls-native" or "redis-tls-rustls" to enable Redis TLS support
ARG CARGO_FEATURES=""
# Copy
COPY . .
RUN --mount=type=cache,target=/usr/local/cargo/registry \
--mount=type=cache,target=/usr/local/cargo/git \
--mount=type=cache,target=/usr/app/target \
if [ -n "$CARGO_FEATURES" ]; then \
cargo install --root /usr/app --path . --debug --locked --features "$CARGO_FEATURES"; \
else \
cargo install --root /usr/app --path . --debug --locked; \
fi
# Setting up build directories
FROM cgr.dev/chainguard/wolfi-base
WORKDIR /app
COPY --from=base --chown=nonroot:nonroot /usr/app/bin/openzeppelin-relayer /app/openzeppelin-relayer
COPY --from=base /usr/lib/libssl.so.3 /usr/lib/libssl.so.3
COPY --from=base /usr/lib/libcrypto.so.3 /usr/lib/libcrypto.so.3
# 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"]