Skip to content

Commit

Permalink
Fixed dockerfile (#30)
Browse files Browse the repository at this point in the history
  • Loading branch information
begmaroman authored and Stefan-Ethernal committed Sep 17, 2024
1 parent b5f3e53 commit 9d9b94f
Showing 1 changed file with 10 additions and 6 deletions.
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"]

0 comments on commit 9d9b94f

Please sign in to comment.