-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
26de433
commit 7ab8200
Showing
7 changed files
with
150 additions
and
178 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 |
---|---|---|
@@ -0,0 +1,89 @@ | ||
variable SHA_SHORT { | ||
default = "123456" | ||
} | ||
|
||
variable TAG { | ||
default = "latest-dev" | ||
} | ||
|
||
variable REGISTRY { | ||
default = "ghcr.io/peerdb-io" | ||
} | ||
|
||
group "default" { | ||
targets = [ | ||
"peerdb", | ||
"flow-worker", | ||
"flow-api", | ||
"flow-snapshot-worker", | ||
"peerdb-ui" | ||
] | ||
} | ||
|
||
target "flow-api" { | ||
context = "." | ||
dockerfile = "stacks/flow.Dockerfile" | ||
target = "flow-api" | ||
platforms = [ | ||
"linux/amd64", | ||
"linux/arm64", | ||
] | ||
tags = [ | ||
"${REGISTRY}/flow-api:${TAG}", | ||
"${REGISTRY}/flow-api:${SHA_SHORT}", | ||
] | ||
} | ||
|
||
target "flow-snapshot-worker" { | ||
context = "." | ||
dockerfile = "stacks/flow.Dockerfile" | ||
target = "flow-snapshot-worker" | ||
platforms = [ | ||
"linux/amd64", | ||
"linux/arm64", | ||
] | ||
tags = [ | ||
"${REGISTRY}/flow-snapshot-worker:${TAG}", | ||
"${REGISTRY}/flow-snapshot-worker:${SHA_SHORT}", | ||
] | ||
} | ||
|
||
target "flow-worker" { | ||
context = "." | ||
dockerfile = "stacks/flow.Dockerfile" | ||
target = "flow-worker" | ||
platforms = [ | ||
"linux/amd64", | ||
"linux/arm64", | ||
] | ||
tags = [ | ||
"${REGISTRY}/flow-worker:${TAG}", | ||
"${REGISTRY}/flow-worker:${SHA_SHORT}", | ||
] | ||
} | ||
|
||
target "peerdb" { | ||
context = "." | ||
dockerfile = "stacks/peerdb-server.Dockerfile" | ||
platforms = [ | ||
"linux/amd64", | ||
"linux/arm64", | ||
] | ||
tags = [ | ||
"${REGISTRY}/peerdb-server:${TAG}", | ||
"${REGISTRY}/peerdb-server:${SHA_SHORT}", | ||
] | ||
} | ||
|
||
target "peerdb-ui" { | ||
context = "." | ||
dockerfile = "stacks/peerdb-ui.Dockerfile" | ||
platforms = [ | ||
"linux/amd64", | ||
"linux/arm64", | ||
] | ||
tags = [ | ||
"${REGISTRY}/peerdb-ui:${TAG}", | ||
"${REGISTRY}/peerdb-ui:${SHA_SHORT}", | ||
] | ||
} |
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 was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# syntax=docker/dockerfile:1.2 | ||
|
||
FROM golang:1.21.3-bookworm AS builder | ||
RUN apt-get update && apt-get install -y gcc libgeos-dev | ||
WORKDIR /root/flow | ||
|
||
# first copy only go.mod and go.sum to cache dependencies | ||
COPY flow/go.mod . | ||
COPY flow/go.sum . | ||
|
||
# download all the dependencies | ||
RUN go mod download | ||
|
||
# Copy all the code | ||
COPY flow . | ||
|
||
# build the binary from cmd folder | ||
WORKDIR /root/flow/cmd | ||
ENV CGO_ENABLED=1 | ||
RUN go build -ldflags="-s -w" -o /root/peer-flow . | ||
|
||
FROM debian:bookworm-slim AS flow-base | ||
RUN apt-get update && apt-get install -y ca-certificates gcc libgeos-dev | ||
WORKDIR /root | ||
COPY --from=builder /root/peer-flow . | ||
|
||
FROM flow-base AS flow-api | ||
EXPOSE 8112 | ||
EXPOSE 8113 | ||
ENTRYPOINT [\ | ||
"./peer-flow",\ | ||
"api",\ | ||
"--port",\ | ||
"8112",\ | ||
"--gateway-port",\ | ||
"8113"\ | ||
] | ||
|
||
FROM flow-base AS flow-worker | ||
ENTRYPOINT [\ | ||
"./peer-flow",\ | ||
"worker"\ | ||
] | ||
|
||
FROM flow-base AS flow-snapshot-worker | ||
ENTRYPOINT [\ | ||
"./peer-flow",\ | ||
"snapshot-worker"\ | ||
] |