feat: add container deploy path (Containerfile, self-provisioning entrypoint, Forgejo registry push)
This commit is contained in:
parent
fd847d035f
commit
50e5e444bc
5 changed files with 100 additions and 3 deletions
22
Containerfile
Normal file
22
Containerfile
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
# Default (non-rns) build only: microReticulum's cmake/C++ build isn't set
|
||||
# up for the musl toolchain alpine gives us, mirroring packages.static in
|
||||
# flake.nix. Use the Nix flake if you need the rns feature.
|
||||
FROM rust:1-alpine AS builder
|
||||
RUN apk add --no-cache musl-dev gcc
|
||||
WORKDIR /usr/src/bunshin
|
||||
COPY Cargo.toml Cargo.lock build.rs ./
|
||||
COPY src ./src
|
||||
RUN cargo build --release --locked
|
||||
|
||||
FROM alpine:3.20
|
||||
RUN apk add --no-cache ca-certificates \
|
||||
&& adduser -D -h /data -u 10000 bunshin
|
||||
COPY --from=builder /usr/src/bunshin/target/release/bunshin /usr/local/bin/bunshin
|
||||
COPY docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
|
||||
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
|
||||
USER bunshin
|
||||
WORKDIR /data
|
||||
VOLUME /data
|
||||
EXPOSE 1961/tcp
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
CMD ["serve", "--key", "/data/server.key", "--db", "/data/mail.db", "--host", "0.0.0.0", "--port", "1961"]
|
||||
Loading…
Add table
Add a link
Reference in a new issue