fiddling with dockerfile
This commit is contained in:
parent
da92bbd9c0
commit
37a2c8896a
@ -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/
|
Loading…
Reference in New Issue
Block a user