2021-05-12 15:07:11 +03:00
|
|
|
FROM node:14.16.0 as frontend
|
2021-05-04 08:00:22 +03:00
|
|
|
|
2021-06-02 15:47:25 +03:00
|
|
|
LABEL org.opencontainers.image.source https://github.com/mCaptcha/mCaptcha
|
2021-05-04 08:00:22 +03:00
|
|
|
|
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-06-02 15:47:25 +03:00
|
|
|
RUN useradd -ms /bin/bash -u 1001 mcaptcha
|
|
|
|
WORKDIR /home/mcaptcha
|
|
|
|
COPY --from=rust /src/target/release/mcaptcha /usr/local/bin/
|
|
|
|
COPY --from=rust /src/config/default.toml /etc/mcaptcha/config.toml
|
|
|
|
USER mcaptcha
|
|
|
|
CMD [ "/usr/local/bin/mcaptcha" ]
|