Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Dockerfile #30

Merged
merged 2 commits into from
Aug 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 10 additions & 6 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,22 @@ FROM golang:1.22.5-alpine3.20 AS build
WORKDIR $GOPATH/src/github.com/0xPolygon/cdk

RUN apk update && apk add --no-cache make build-base git

# INSTALL DEPENDENCIES
COPY go.mod go.sum /src/
RUN cd /src && go mod download
COPY go.mod go.sum ./
RUN go mod download

# BUILD BINARY
COPY . /src
RUN cd /src && make build
COPY . .
RUN make build

# CONTAINER FOR RUNNING BINARY
FROM alpine:3.20
COPY --from=build /src/dist/cdk /app/cdk
RUN mkdir /app/data && apk update && apk add postgresql15-client

COPY --from=build /go/src/github.com/0xPolygon/cdk/dist/cdk /app/cdk

RUN mkdir /app/data && apk update && apk add postgresql15-client

EXPOSE 8123

CMD ["/bin/sh", "-c", "/app/cdk run"]
Loading