try to implement docker
This commit is contained in:
1 parent
94adeb2b69
commit
87baf8c8e8
5 files changed
+135
No files matched your search
@@ -0,0 +1,34 @@
|
||||
FROM golang:1.26-bookworm AS build
|
||||
ENV CGO_ENABLED=0
|
||||
WORKDIR /src
|
||||
|
||||
COPY relay /src/relay
|
||||
COPY headless /src/headless
|
||||
|
||||
RUN go -C /src/headless/vk build -trimpath -ldflags="-s -w" -o /out/headless-vk-creator . \
|
||||
&& go -C /src/headless/telemost build -trimpath -ldflags="-s -w" -o /out/headless-telemost-creator . \
|
||||
&& go -C /src/headless/wbstream build -trimpath -ldflags="-s -w" -o /out/headless-wbstream-creator . \
|
||||
&& go -C /src/headless/vk-bot build -trimpath -ldflags="-s -w" -o /out/headless-vk-bot .
|
||||
|
||||
FROM debian:bookworm-slim
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends ca-certificates tini \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN useradd --system --create-home --home /home/wlb --shell /usr/sbin/nologin wlb \
|
||||
&& mkdir -p /opt/wlb/bin /data/sessions \
|
||||
&& chown -R wlb:wlb /data
|
||||
|
||||
COPY --from=build /out/headless-vk-creator /opt/wlb/bin/
|
||||
COPY --from=build /out/headless-telemost-creator /opt/wlb/bin/
|
||||
COPY --from=build /out/headless-wbstream-creator /opt/wlb/bin/
|
||||
COPY --from=build /out/headless-vk-bot /usr/local/bin/
|
||||
|
||||
COPY headless/docker/entrypoint.sh /usr/local/bin/wlb-entrypoint
|
||||
RUN chmod +x /usr/local/bin/wlb-entrypoint
|
||||
|
||||
USER wlb
|
||||
WORKDIR /data
|
||||
VOLUME ["/data"]
|
||||
|
||||
ENTRYPOINT ["/usr/bin/tini", "--", "/usr/local/bin/wlb-entrypoint"]
|
||||
Reference in new issue
Block a user