draught/Dockerfile
Andy Pack e4dbbf5c14
Some checks failed
test and deploy / Package Library (push) Blocked by required conditions
test and deploy / Package Container (push) Blocked by required conditions
test and deploy / Build WASM (push) Has been cancelled
test and deploy / Build Native (push) Has been cancelled
updating toolchains
2024-07-28 15:49:38 +01:00

25 lines
647 B
Docker

FROM rust:1.78 AS rust-build
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
COPY . /draught
WORKDIR /draught/draught_web
RUN wasm-pack build --release
WORKDIR /draught
RUN cargo doc --no-deps --document-private-items
FROM node:22-alpine AS js-build
COPY . /draught
WORKDIR /draught/draught_web
COPY --from=rust-build /draught/draught_web/pkg /draught/draught_web/pkg
WORKDIR /draught/draught_web/www
RUN npm ci
RUN npm run build --if-present
COPY --from=rust-build /draught/target/doc /draught/draught_web/www/dist/
FROM nginx:alpine-slim
COPY --from=js-build /draught/draught_web/www/dist /usr/share/nginx/html/