Containerfile, composefile and makefile target for building images
This commit is contained in:
parent
0b11ac87cd
commit
64553bb153
3 changed files with 30 additions and 0 deletions
16
Containerfile
Normal file
16
Containerfile
Normal file
|
@ -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"]
|
3
Makefile
3
Makefile
|
@ -4,5 +4,8 @@ run:
|
||||||
build:
|
build:
|
||||||
go build -o beretta src/*.go
|
go build -o beretta src/*.go
|
||||||
|
|
||||||
|
build-container:
|
||||||
|
podman build -t beretta .
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm beretta
|
rm beretta
|
||||||
|
|
11
docker-compose.yml
Normal file
11
docker-compose.yml
Normal file
|
@ -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
|
Loading…
Add table
Reference in a new issue