This commit is contained in:
parent
bfd62fa4ef
commit
1e950b9efc
2 changed files with 13 additions and 2 deletions
|
|
@ -1,15 +1,20 @@
|
|||
# build the executable in its own stage. rust is big
|
||||
FROM rust:alpine AS builder
|
||||
WORKDIR /usr/src/stargate
|
||||
|
||||
# install build dependencies
|
||||
RUN apk add musl-dev
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN cargo install --path .
|
||||
|
||||
# final image
|
||||
FROM alpine:3.22
|
||||
# copy executable from builder image
|
||||
COPY --from=builder /usr/local/cargo/bin/stargate /usr/local/bin/stargate
|
||||
|
||||
# set working directory to /etc/stargate, config file should be included here
|
||||
WORKDIR /etc/stargate
|
||||
|
||||
CMD ["stargate"]
|
||||
CMD ["stargate"]
|
||||
|
|
|
|||
|
|
@ -1,17 +1,23 @@
|
|||
# build the executable in its own stage. rust is big
|
||||
FROM rust:alpine AS builder
|
||||
WORKDIR /usr/src/stargate
|
||||
|
||||
# install build dependencies
|
||||
RUN apk add musl-dev
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN cargo install --features rich --path .
|
||||
|
||||
# final image
|
||||
FROM alpine:3.22
|
||||
# copy executable from builder image
|
||||
COPY --from=builder /usr/local/cargo/bin/stargate /usr/local/bin/stargate
|
||||
|
||||
# set working directory to /etc/stargate, config file should be included here
|
||||
WORKDIR /etc/stargate
|
||||
|
||||
# include tera templates. TODO: figure out how to include at compile time
|
||||
COPY templates templates
|
||||
|
||||
CMD ["stargate"]
|
||||
CMD ["stargate"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue