FROM archlinux:latest RUN pacman -Sy rustup gcc which --noconfirm WORKDIR /app/ RUN rustup toolchain install nightly && \ rustup default nightly && \ curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh ADD ./bitque-data /app/bitque-data ADD ./bitque-client /app/bitque-client RUN cd ./bitque-client && \ rm -Rf build && \ mkdir build && \ wasm-pack build --mode normal --release --out-name bitque --out-dir ./build --target web && \ cp -r ./static/* ./build && \ cat ./static/index.js \ | sed -e "s/process.env.JIRS_SERVER_BIND/'$JIRS_SERVER_BIND'/g" \ | sed -e "s/process.env.JIRS_SERVER_PORT/'$JIRS_SERVER_PORT'/g" &> ./build/index.js && \ cp ./js/template.html ./build/index.html && \ mkdir -p /assets && \ cp -r ./build/* /assets CMD cat /app/bitque-client/static/index.js \ | sed -e "s/process.env.JIRS_SERVER_BIND/'$JIRS_SERVER_BIND'/g" \ | sed -e "s/process.env.JIRS_SERVER_PORT/'$JIRS_SERVER_PORT'/g" &> /assets/index.js