From 10d595be4072712af269a5fbc4060f74597d36a3 Mon Sep 17 00:00:00 2001 From: Alexandre Date: Mon, 13 Nov 2023 16:02:17 +0100 Subject: [PATCH] dockerfile (#9) Co-authored-by: Alexandre Hanot <> --- Dockerfile | 20 ++++++++++++++++++++ Justfile | 6 +++++- applications/web/Trunk.toml | 5 +++++ 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0829f8c --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM rust:slim-bookworm + +# Install wasm +RUN rustup target add wasm32-unknown-unknown + +# Install trunk +RUN cargo install --locked trunk + +# Copy the source code into the container +COPY . . + +# Build the application using Trunk +WORKDIR /applications/web + +# Expose the port +EXPOSE 8080 + +# Start a server and serve static files +CMD [ "trunk", "serve" ] + diff --git a/Justfile b/Justfile index e4db9c1..f8aad50 100644 --- a/Justfile +++ b/Justfile @@ -1,4 +1,8 @@ dev: (cd applications/web && trunk serve) - +build: + docker build -t todolist . + +start: + docker run -p 8080:8080 todolist diff --git a/applications/web/Trunk.toml b/applications/web/Trunk.toml index c3e1c5d..9e9d022 100644 --- a/applications/web/Trunk.toml +++ b/applications/web/Trunk.toml @@ -1,5 +1,10 @@ [watch] +# Paths to watch. The `build.target`'s parent folder is watched by default. watch = [ "../../drivers/ui/src", "../../interactions/src", ] + +[serve] +# The address to serve on. +address = "0.0.0.0"