diff --git a/.containerignore b/.containerignore new file mode 100644 index 0000000..aa9e0d9 --- /dev/null +++ b/.containerignore @@ -0,0 +1,3 @@ +dist +target +.idea \ No newline at end of file diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..056f9b9 --- /dev/null +++ b/Containerfile @@ -0,0 +1,28 @@ +FROM docker.io/bitnami/minideb:bullseye AS build-base +RUN apt update +RUN apt install -y \ + build-essential \ + curl \ + bash \ + clang \ + nodejs \ + wget \ + npm +RUN curl https://sh.rustup.rs -sSf | bash -s -- --profile minimal -y +ENV PATH="/root/.cargo/bin:${PATH}" +RUN rustup target add wasm32-unknown-unknown +RUN wget -qO- https://github.com/thedodd/trunk/releases/latest/download/${VERSION}/trunk-x86_64-unknown-linux-gnu.tar.gz | tar -xzf- +RUN cp trunk /bin +RUN trunk --version +RUN rm -rf /var/lib/{apt,dpkg,cache,log}/ /var/cache + +FROM build-base AS builder +WORKDIR /usr/src +COPY . . +RUN cargo fetch --target wasm32-unknown-unknown +RUN ls +RUN trunk build --release + +FROM docker.io/nginx:alpine +COPY --from=builder /usr/src/dist/ /usr/share/nginx/html +CMD ["nginx", "-g", "daemon off;"] \ No newline at end of file diff --git a/index.html b/index.html index 14c033e..c8405a2 100644 --- a/index.html +++ b/index.html @@ -3,6 +3,6 @@ - + \ No newline at end of file