2021-05-12 12:07:11 +00:00
|
|
|
FROM node:14.16.0 as frontend
|
2021-05-04 05:00:22 +00:00
|
|
|
|
|
|
|
LABEL org.opencontainers.image.source https://github.com/mCaptcha/guard
|
|
|
|
|
2021-05-12 12:07:11 +00:00
|
|
|
WORKDIR /src
|
|
|
|
COPY package.json yarn.lock ./
|
|
|
|
RUN yarn install
|
|
|
|
COPY . .
|
|
|
|
RUN yarn build
|
|
|
|
|
|
|
|
FROM rust:latest as rust
|
|
|
|
COPY --from=frontend /src /src
|
|
|
|
WORKDIR /src
|
|
|
|
RUN cargo build --release
|
2021-05-04 05:00:22 +00:00
|
|
|
|
2021-05-12 12:07:11 +00:00
|
|
|
FROM debian:buster
|
2021-05-04 05:00:22 +00:00
|
|
|
RUN useradd -ms /bin/bash -u 1001 guard
|
|
|
|
WORKDIR /home/guard
|
2021-05-12 12:53:25 +00:00
|
|
|
COPY --from=rust /src/target/release/guard /usr/local/bin/
|
|
|
|
COPY --from=rust /src/config/default.toml /etc/guard/config.toml
|
2021-05-04 05:00:22 +00:00
|
|
|
USER guard
|
2021-05-12 12:53:25 +00:00
|
|
|
CMD [ "/usr/local/bin/guard" ]
|