add dockerfiler
This commit is contained in:
26
Dockerfile
Normal file
26
Dockerfile
Normal file
@@ -0,0 +1,26 @@
|
||||
FROM golang:1.24-alpine AS builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV GOTOOLCHAIN=auto
|
||||
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . ./
|
||||
|
||||
RUN CGO_ENABLED=0 GOOS=$TARGETOS GOARCH=$TARGETARCH go build -o /ax .
|
||||
|
||||
FROM alpine:latest
|
||||
|
||||
RUN apk --no-cache add ca-certificates
|
||||
|
||||
WORKDIR /data
|
||||
|
||||
COPY --from=builder /ax /app/ax
|
||||
|
||||
ENV AX_DB_PATH=/data/.ax.db
|
||||
|
||||
EXPOSE 7000
|
||||
|
||||
ENTRYPOINT ["/app/ax", "serve"]
|
||||
Reference in New Issue
Block a user