2021-05-12 15:07:11 +03:00
|
|
|
FROM node:14.16.0 as frontend
|
2021-05-04 08:00:22 +03:00
|
|
|
|
|
|
|
LABEL org.opencontainers.image.source https://github.com/mCaptcha/guard
|
|
|
|
|
2021-05-12 15:07:11 +03: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 08:00:22 +03:00
|
|
|
|
2021-05-12 15:07:11 +03:00
|
|
|
FROM debian:buster
|
2021-05-04 08:00:22 +03:00
|
|
|
RUN useradd -ms /bin/bash -u 1001 guard
|
|
|
|
WORKDIR /home/guard
|
2021-05-12 15:53:25 +03: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 08:00:22 +03:00
|
|
|
USER guard
|
2021-05-12 15:53:25 +03:00
|
|
|
CMD [ "/usr/local/bin/guard" ]
|