game-of-life/Dockerfile
Andy Pack 6ad986e922
Some checks failed
test and deploy / package (push) Blocked by required conditions
test and deploy / build (push) Has been cancelled
updating container versions, deploy token
2024-07-22 19:27:46 +01:00

23 lines
506 B
Docker

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