From 0587e7d63d91ba6bd82cf46c7eb912c30858581e Mon Sep 17 00:00:00 2001 From: Marius Scurtescu Date: Sat, 17 Feb 2024 20:52:11 -0800 Subject: [PATCH] add basic Docker configuration (#46) * add initial Dockerfile * use alpine, build all source code, use ENTRYPOINT instead of CMD * add initial docker-compose.yml * map ports * add labels to image * fully specify base image version * add logging config * map .config to host folder instead of volume --- Dockerfile | 20 ++++++++++++++++++++ docker-compose.yml | 20 ++++++++++++++++++++ 2 files changed, 40 insertions(+) create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..c401150 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM golang:1.20.14-alpine3.19 + +LABEL org.opencontainers.image.title="Quilibrium Network Node" +LABEL org.opencontainers.image.description="Quilibrium is a decentralized alternative to platform as a service providers." +LABEL org.opencontainers.image.vendor=Quilibrium +LABEL org.opencontainers.image.url=https://quilibrium.com/ +LABEL org.opencontainers.image.documentation=https://quilibrium.com/docs + +ENV GOEXPERIMENT=arenas + +WORKDIR /opt/ceremonyclient + +COPY . . + +WORKDIR /opt/ceremonyclient/node + +RUN go mod download && go mod verify +RUN go build ./... + +ENTRYPOINT ["go", "run", "./..."] diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..3f19c89 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,20 @@ +version: "3.8" + +name: quilibrium + +services: + node: + build: ./ + image: quilibrium + restart: always + ports: + - '8336:8336/udp' # p2p + - '127.0.0.1:8337:8337/tcp' # gRPC + - '127.0.0.1:8338:8338/tcp' # REST + volumes: + - ./.config:/opt/ceremonyclient/node/.config + logging: + driver: "json-file" + options: + max-file: "5" + max-size: 2048m