draught/Dockerfile

23 lines
545 B
Docker
Raw Normal View History

2023-05-16 17:58:48 +01:00
FROM rust:1.69 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
2023-05-01 09:10:51 +01:00
COPY . /draught
WORKDIR /draught
2023-05-01 08:47:46 +01:00
RUN wasm-pack build --release
RUN cargo doc --no-deps --document-private-items
FROM node:18-alpine AS js-build
2023-05-01 08:47:46 +01:00
2023-05-01 09:10:51 +01:00
COPY . /draught
WORKDIR /draught
COPY --from=rust-build /draught/pkg /draught/pkg
WORKDIR /draught/www
2023-05-01 08:47:46 +01:00
RUN npm ci
RUN npm run build --if-present
2023-05-01 09:10:51 +01:00
COPY --from=rust-build /draught/target/doc /draught/www/dist/
2023-05-01 08:47:46 +01:00
FROM nginx:alpine-slim
2023-05-01 09:10:51 +01:00
COPY --from=js-build /draught/www/dist /usr/share/nginx/html/