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
This commit is contained in:
Marius Scurtescu 2024-02-17 20:52:11 -08:00 committed by GitHub
parent 1b810d624c
commit 0587e7d63d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 40 additions and 0 deletions

20
Dockerfile Normal file
View File

@ -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", "./..."]

20
docker-compose.yml Normal file
View File

@ -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