2020-06-04 20:47:10 +02:00
|
|
|
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
|
|
|
|
|
2023-03-31 23:25:20 +02:00
|
|
|
ADD ./bitque-data /app/bitque-data
|
2020-06-04 20:47:10 +02:00
|
|
|
|
2023-03-31 23:25:20 +02:00
|
|
|
ADD ./bitque-client /app/bitque-client
|
2020-06-04 20:47:10 +02:00
|
|
|
|
2023-03-31 23:25:20 +02:00
|
|
|
RUN cd ./bitque-client && \
|
2020-06-04 20:47:10 +02:00
|
|
|
rm -Rf build && \
|
|
|
|
mkdir build && \
|
2023-03-31 23:25:20 +02:00
|
|
|
wasm-pack build --mode normal --release --out-name bitque --out-dir ./build --target web && \
|
2020-06-04 20:47:10 +02:00
|
|
|
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
|
|
|
|
|
2023-03-31 23:25:20 +02:00
|
|
|
CMD cat /app/bitque-client/static/index.js \
|
2020-06-04 20:47:10 +02:00
|
|
|
| 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
|