2022-05-09 21:23:51 +00:00
|
|
|
# latest rust will be used to build the binary
|
|
|
|
FROM rust:latest as builder
|
|
|
|
|
|
|
|
# the temporary directory where we build
|
|
|
|
WORKDIR /usr/src/microbin
|
|
|
|
|
|
|
|
# copy sources to /usr/src/microbin on the temporary container
|
|
|
|
COPY . .
|
|
|
|
|
|
|
|
# run release build
|
|
|
|
RUN cargo build --release
|
|
|
|
|
|
|
|
# create final container using slim version of debian
|
|
|
|
FROM debian:buster-slim
|
|
|
|
|
|
|
|
# microbin will be in /usr/local/bin/microbin/
|
|
|
|
WORKDIR /usr/local/bin
|
|
|
|
|
|
|
|
# copy built exacutable
|
|
|
|
COPY --from=builder /usr/src/microbin/target/release/microbin /usr/local/bin/microbin
|
|
|
|
|
|
|
|
# copy /static folder containing the stylesheets
|
|
|
|
COPY --from=builder /usr/src/microbin/static /usr/local/bin/static
|
|
|
|
|
2022-05-22 18:26:43 +00:00
|
|
|
# Install Ruby (no need if you're disabling all plugins)
|
|
|
|
RUN \
|
|
|
|
apt-get update && \
|
|
|
|
apt-get install -y ruby
|
|
|
|
|
2022-05-09 21:23:51 +00:00
|
|
|
# run the binary
|
|
|
|
CMD ["microbin"]
|