18 lines
644 B
Docker
18 lines
644 B
Docker
# syntax=docker/dockerfile:1
|
|
FROM golang:1.26.6-alpine AS build
|
|
WORKDIR /src
|
|
COPY go.mod ./
|
|
COPY . .
|
|
ARG TARGET
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -o /out/runtime ./cmd/${TARGET}
|
|
|
|
FROM alpine:3.23
|
|
ARG SOURCE_REVISION=unknown
|
|
LABEL org.opencontainers.image.revision=$SOURCE_REVISION \
|
|
org.opencontainers.image.source="https://git.cin.su/m/Assistant.git"
|
|
RUN addgroup -S assistant && adduser -S -G assistant assistant
|
|
RUN mkdir -p /var/lib/supervisor && chown assistant:assistant /var/lib/supervisor
|
|
USER assistant
|
|
COPY --from=build /out/runtime /usr/local/bin/assistant-runtime
|
|
ENTRYPOINT ["/usr/local/bin/assistant-runtime"]
|