bitque/crates/web/Dockerfile

30 lines
1.0 KiB
Docker
Raw Normal View History

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 \
2023-04-04 17:14:31 +02:00
| sed -e "s/process.env.BITQUE_SERVER_BIND/'$BITQUE_SERVER_BIND'/g" \
| sed -e "s/process.env.BITQUE_SERVER_PORT/'$BITQUE_SERVER_PORT'/g" &> ./build/index.js && \
2020-06-04 20:47:10 +02:00
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 \
2023-04-04 17:14:31 +02:00
| sed -e "s/process.env.BITQUE_SERVER_BIND/'$BITQUE_SERVER_BIND'/g" \
| sed -e "s/process.env.BITQUE_SERVER_PORT/'$BITQUE_SERVER_PORT'/g" &> /assets/index.js