fiddling with dockerfile

This commit is contained in:
Andy Pack 2024-02-01 19:00:29 +00:00
parent da92bbd9c0
commit 37a2c8896a
Signed by: sarsoo
GPG Key ID: A55BA3536A5E0ED7

View File

@ -2,22 +2,24 @@ FROM rust:1.71 AS rust-build
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
COPY . /draught
WORKDIR /draught
COPY .. /draught
WORKDIR /draught/draught_web
RUN wasm-pack build --release
WORKDIR /draught
RUN cargo doc --no-deps --document-private-items
FROM node:20-alpine AS js-build
COPY . /draught
WORKDIR /draught
COPY .. /draught
WORKDIR /draught/draught_web
COPY --from=rust-build /draught/pkg /draught/pkg
WORKDIR /draught/www
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/www/dist/
COPY --from=rust-build /draught/target/doc /draught/draught_web/www/dist/
FROM nginx:alpine-slim
COPY --from=js-build /draught/www/dist /usr/share/nginx/html/
COPY --from=js-build /draught/draught_web/www/dist /usr/share/nginx/html/