2024-07-28 15:49:38 +01:00
|
|
|
FROM rust:1.78 AS rust-build
|
2023-05-01 08:47:46 +01:00
|
|
|
|
2023-05-16 17:58:48 +01:00
|
|
|
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
2023-05-01 08:47:46 +01:00
|
|
|
|
2024-02-01 19:05:13 +00:00
|
|
|
COPY . /draught
|
2024-02-01 19:00:29 +00:00
|
|
|
WORKDIR /draught/draught_web
|
2023-05-01 08:47:46 +01:00
|
|
|
|
|
|
|
RUN wasm-pack build --release
|
2024-02-01 19:00:29 +00:00
|
|
|
|
|
|
|
WORKDIR /draught
|
2023-05-01 08:47:46 +01:00
|
|
|
RUN cargo doc --no-deps --document-private-items
|
|
|
|
|
2024-07-28 15:49:38 +01:00
|
|
|
FROM node:22-alpine AS js-build
|
2023-05-01 08:47:46 +01:00
|
|
|
|
2024-02-01 19:05:13 +00:00
|
|
|
COPY . /draught
|
2024-02-01 19:00:29 +00:00
|
|
|
WORKDIR /draught/draught_web
|
2023-05-01 09:10:51 +01:00
|
|
|
|
2024-02-01 19:00:29 +00:00
|
|
|
COPY --from=rust-build /draught/draught_web/pkg /draught/draught_web/pkg
|
|
|
|
WORKDIR /draught/draught_web/www
|
2023-05-01 08:47:46 +01:00
|
|
|
RUN npm ci
|
|
|
|
RUN npm run build --if-present
|
2024-02-01 19:00:29 +00:00
|
|
|
COPY --from=rust-build /draught/target/doc /draught/draught_web/www/dist/
|
2023-05-01 08:47:46 +01:00
|
|
|
|
2023-05-16 17:46:13 +01:00
|
|
|
FROM nginx:alpine-slim
|
2024-02-01 19:00:29 +00:00
|
|
|
COPY --from=js-build /draught/draught_web/www/dist /usr/share/nginx/html/
|