From 64553bb153097af0a9d830f11d2b5fe8d38462ff Mon Sep 17 00:00:00 2001 From: Imbus <> Date: Tue, 24 Jun 2025 12:35:49 +0200 Subject: [PATCH] Containerfile, composefile and makefile target for building images --- Containerfile | 16 ++++++++++++++++ Makefile | 3 +++ docker-compose.yml | 11 +++++++++++ 3 files changed, 30 insertions(+) create mode 100644 Containerfile create mode 100644 docker-compose.yml diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..e47e4e0 --- /dev/null +++ b/Containerfile @@ -0,0 +1,16 @@ +FROM docker.io/golang:1.24 AS builder +WORKDIR /app +COPY go.mod go.sum ./ +RUN go mod download +COPY src src +RUN GOOS=linux go build -o beretta src/*.go +# FROM docker.io/alpine:3 +FROM docker.io/debian:bookworm-slim + +RUN apt-get update && apt-get install -y \ + ca-certificates \ + sqlite3 \ + && rm -rf /var/lib/apt/lists/* + +COPY --from=builder /app/beretta /beretta +ENTRYPOINT ["/beretta"] diff --git a/Makefile b/Makefile index 54bdd5e..4e2262c 100644 --- a/Makefile +++ b/Makefile @@ -4,5 +4,8 @@ run: build: go build -o beretta src/*.go +build-container: + podman build -t beretta . + clean: rm beretta diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..275408c --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,11 @@ +services: + beretta: + image: beretta:latest + name: beretta-server + build: + context: . + command: > + -config /data/beretta.json + -db /data/cache.db + volumes: + - ./data:/data:Z