survey/Dockerfile
Aravinth Manivannan 0ba21e184d
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/pr/woodpecker Pipeline failed
fix: install libssk-dev to compile openssl
2023-11-02 17:06:44 +05:30

24 lines
782 B
Docker

FROM node:18-bookworm-slim as frontend
LABEL org.opencontainers.image.source https://github.com/mCaptcha/survey
RUN apt-get update && apt-get install -y make
COPY package.json yarn.lock /src/
COPY vendor/ /src/vendor
WORKDIR /src
RUN yarn install
COPY . .
RUN make frontend
FROM rust:1-slim-bookworm as rust
WORKDIR /src
RUN apt-get update && apt-get install -y git libssl-dev
COPY . /src
COPY --from=frontend /src/static/cache/bundle /src/static/cache/bundle
RUN cargo build --release
FROM debian:bookworm-slim
RUN useradd -ms /bin/bash -u 1001 mcaptcha-survey
WORKDIR /home/mcaptcha-survey
COPY --from=rust /src/target/release/survey /usr/local/bin/
COPY --from=rust /src/config/default.toml /etc/mcaptcha-survey/config.toml
USER mcaptcha-survey
CMD [ "/usr/local/bin/survey" ]