container: build and ship cmd/createuser in the server image
Mirrors the telesrv-admin pattern - a static build stage compile, copied into the final alpine image as /app/createuser - so the tool is available wherever the server image runs, not just from a local go run.
This commit is contained in:
parent
38112062a1
commit
e81742ba51
1 changed files with 2 additions and 0 deletions
|
|
@ -18,12 +18,14 @@ RUN CGO_ENABLED=0 go build -trimpath \
|
|||
-ldflags "-X main.gitCommit=${GIT_COMMIT} -X main.gitBranch=${GIT_BRANCH} -X main.gitTreeState=${GIT_TREE_STATE} -X main.buildTime=${BUILD_TIME}" \
|
||||
-o /out/gramsrv ./cmd/telesrv
|
||||
RUN CGO_ENABLED=0 go build -trimpath -o /out/telesrv-admin ./cmd/telesrv-admin
|
||||
RUN CGO_ENABLED=0 go build -trimpath -o /out/createuser ./cmd/createuser
|
||||
|
||||
FROM docker.io/library/alpine:3.20
|
||||
RUN apk add --no-cache ca-certificates tzdata ffmpeg
|
||||
WORKDIR /app
|
||||
COPY --from=build /out/gramsrv /app/gramsrv
|
||||
COPY --from=build /out/telesrv-admin /app/telesrv-admin
|
||||
COPY --from=build /out/createuser /app/createuser
|
||||
COPY --from=build /src/data/langpack /app/data/langpack
|
||||
COPY --from=build /src/data/sticker-seed /app/data/sticker-seed
|
||||
EXPOSE 2398 2600
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue