2023-05-16 17:47:50 +01:00
|
|
|
FROM rust:1.69-alpine AS rust-build
|
2023-05-01 17:01:42 +01:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2023-05-16 17:47:50 +01:00
|
|
|
FROM node:18-alpine AS js-build
|
2023-05-01 17:01:42 +01:00
|
|
|
|
|
|
|
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/
|
|
|
|
|
2023-05-16 17:47:50 +01:00
|
|
|
FROM nginx:alpine-slim
|
2023-05-01 17:01:42 +01:00
|
|
|
COPY --from=js-build /gof/www/dist /usr/share/nginx/html/
|