aboutsummaryrefslogtreecommitdiff
path: root/Containerfile
diff options
context:
space:
mode:
authorXander <xander@biltopia.org>2023-10-22 12:31:51 +0200
committerXander <xander@biltopia.org>2023-10-22 12:31:51 +0200
commit3ac0ecfec25617e5282f507de615c8ea5a29b69d (patch)
tree3c8539c026c5356947896cf751bfe576461f97ef /Containerfile
parentccee0f7ca6dc2b2542b84922d855f51204033b8a (diff)
downloadplanetwars.dev-3ac0ecfec25617e5282f507de615c8ea5a29b69d.tar.xz
planetwars.dev-3ac0ecfec25617e5282f507de615c8ea5a29b69d.zip
Add containerfile and fix all issues
Diffstat (limited to 'Containerfile')
-rw-r--r--Containerfile29
1 files changed, 29 insertions, 0 deletions
diff --git a/Containerfile b/Containerfile
new file mode 100644
index 0000000..9284d9f
--- /dev/null
+++ b/Containerfile
@@ -0,0 +1,29 @@
+FROM rust:latest
+
+RUN curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
+RUN chmod a+r /etc/apt/keyrings/docker.gpg
+RUN echo \
+ "deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
+ "$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
+ tee /etc/apt/sources.list.d/docker.list > /dev/null
+RUN apt-get update && apt-get install cmake npm docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
+
+WORKDIR /pw
+
+COPY . .
+
+RUN cargo build --release
+
+RUN cargo install wasm-pack
+
+RUN wasm-pack build web/planetwars-rs --target web
+
+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
+
+WORKDIR /pw/planetwars-server
+
+ENTRYPOINT ["../target/release/planetwars-server", "npm --prefix /pw/web/pw-server run preview -- --host"]