-
Notifications
You must be signed in to change notification settings - Fork 56
Expand file tree
/
Copy pathDockerfile.development
More file actions
52 lines (35 loc) · 1.17 KB
/
Dockerfile.development
File metadata and controls
52 lines (35 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
48
49
50
51
52
# 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/glibc-dynamic:latest-dev
# Node image
FROM cgr.dev/chainguard/node:latest-dev AS node
WORKDIR /app
COPY --from=base --chown=nonroot:nonroot /usr/app/bin/openzeppelin-relayer /app/openzeppelin-relayer
# Install pnpm and ts-node
USER root
RUN npm install -g pnpm ts-node typescript
# Copy plugins folder and install dependencies
COPY --chown=nobody ./plugins /app/plugins
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
USER nobody
# starting up
ENTRYPOINT ["/app/openzeppelin-relayer"]