mirror of
https://github.com/mCaptcha/mCaptcha.git
synced 2026-02-11 10:05:41 +00:00
docker: wasm build step
This commit is contained in:
20
Dockerfile
20
Dockerfile
@@ -1,16 +1,28 @@
|
||||
FROM node:14.16.0 as frontend
|
||||
FROM rust:latest as wasm
|
||||
|
||||
LABEL org.opencontainers.image.source https://github.com/mCaptcha/mCaptcha
|
||||
|
||||
RUN curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
|
||||
COPY browser/ /browser
|
||||
WORKDIR /browser
|
||||
RUN wasm-pack build --release
|
||||
|
||||
FROM node:14.16.0 as frontend
|
||||
COPY package.json yarn.lock /src/
|
||||
COPY --from=wasm /browser /src/browser
|
||||
WORKDIR /src
|
||||
COPY package.json yarn.lock ./
|
||||
RUN yarn install
|
||||
COPY . .
|
||||
WORKDIR /
|
||||
RUN mkdir -p /src/static/cache/bundle
|
||||
COPY tsconfig.json webpack.config.js jest.config.ts /src/
|
||||
COPY templates /src/templates
|
||||
WORKDIR /src
|
||||
RUN yarn build
|
||||
|
||||
FROM rust:latest as rust
|
||||
COPY --from=frontend /src /src
|
||||
WORKDIR /src
|
||||
COPY . .
|
||||
COPY --from=frontend /src/static/cache/bundle /src/static/cache/bundle
|
||||
RUN cargo build --release
|
||||
|
||||
FROM debian:buster
|
||||
|
||||
Reference in New Issue
Block a user