aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXander <xander@biltopia.org>2023-10-22 13:54:18 +0200
committerXander <xander@biltopia.org>2023-10-22 13:54:18 +0200
commite137305a036aa3c8d9e19e5655b870694913cbbe (patch)
tree52de061e9f32aebf1f1898322f9e2d9896c17c15
parent3ac0ecfec25617e5282f507de615c8ea5a29b69d (diff)
downloadplanetwars.dev-e137305a036aa3c8d9e19e5655b870694913cbbe.tar.xz
planetwars.dev-e137305a036aa3c8d9e19e5655b870694913cbbe.zip
Update containerfileHEADmain
-rw-r--r--Containerfile10
-rwxr-xr-xstart.sh6
2 files changed, 11 insertions, 5 deletions
diff --git a/Containerfile b/Containerfile
index 9284d9f..263a8a1 100644
--- a/Containerfile
+++ b/Containerfile
@@ -12,18 +12,18 @@ WORKDIR /pw
COPY . .
-RUN cargo build --release
-
RUN cargo install wasm-pack
RUN wasm-pack build web/planetwars-rs --target web
+RUN cargo build --release && rm target/release/build target/release/deps -rf
+
WORKDIR /pw/web/pw-server
RUN npm install --force && npm run build
-RUN sed "s/module.exports=y;//" /pw/web/pw-server/.svelte-kit/output/client/_app/chunks/PlayerLog-c14926a0.js -i
+RUN sed "s/module.exports=y;//" /pw/web/pw-server/.svelte-kit/output/client/_app/chunks/PlayerLog-*.js -i
-WORKDIR /pw/planetwars-server
+WORKDIR /pw
-ENTRYPOINT ["../target/release/planetwars-server", "npm --prefix /pw/web/pw-server run preview -- --host"]
+ENTRYPOINT ["/pw/start.sh"]
diff --git a/start.sh b/start.sh
new file mode 100755
index 0000000..ae4cfa7
--- /dev/null
+++ b/start.sh
@@ -0,0 +1,6 @@
+#!/usr/bin/env bash
+
+cd /pw/planetwars-server
+
+../target/release/planetwars-server &
+npm --prefix /pw/web/pw-server run preview -- --host