forked from 0xPolygonHermez/zkevm-node
-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
include packr command with docker build
- Loading branch information
1 parent
d9f42c6
commit 1633264
Showing
2 changed files
with
15 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,21 @@ | ||
FROM alpine:3.18 | ||
# CONTAINER FOR BUILDING BINARY | ||
FROM golang:1.21 AS build | ||
|
||
RUN apk update && apk add postgresql15-client | ||
# INSTALL DEPENDENCIES | ||
RUN go install github.com/gobuffalo/packr/v2/packr2@v2.8.3 | ||
COPY go.mod go.sum /src/ | ||
RUN cd /src && go mod download | ||
|
||
EXPOSE 8123 | ||
|
||
COPY dist/zkevm-node /app/zkevm-node | ||
# BUILD BINARY | ||
COPY . /src | ||
RUN cd /src/db && packr2 | ||
RUN cd /src && make build | ||
|
||
FROM alpine:3.18 | ||
COPY --from=build /src/dist/zkevm-node /app/zkevm-node | ||
RUN apk update && apk add postgresql15-client | ||
EXPOSE 8123 | ||
RUN addgroup -S zkevm-group \ | ||
&& adduser -S zkevm-user -G zkevm-group | ||
|
||
USER zkevm-user | ||
|
||
CMD ["/bin/sh", "-c", "/app/zkevm-node run"] |