22 lines
757 B
Docker
22 lines
757 B
Docker
FROM golang:1.26-bookworm AS build
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY cmd ./cmd
|
|
COPY internal ./internal
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags="-s -w" -o /out/otche ./cmd/otche
|
|
FROM debian:trixie-slim AS api
|
|
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates && rm -rf /var/lib/apt/lists/* && groupadd -g 10001 otche && useradd -u 10001 -g otche -M otche
|
|
COPY --from=build /out/otche /usr/local/bin/otche
|
|
USER 10001:10001
|
|
WORKDIR /var/lib/otche
|
|
ENTRYPOINT ["otche"]
|
|
CMD ["api"]
|
|
|
|
FROM api AS worker
|
|
USER root
|
|
RUN apt-get update && apt-get install -y --no-install-recommends ffmpeg xorriso && rm -rf /var/lib/apt/lists/*
|
|
COPY windows /opt/otche/windows
|
|
USER 10001:10001
|
|
CMD ["worker"]
|