diff --git a/.dockerignore b/.dockerignore index 1a4d15f..c41aef0 100644 --- a/.dockerignore +++ b/.dockerignore @@ -3,7 +3,6 @@ /.github/ /dist/ /debug/ -/docker/ /node_modules/ /static/ /target/ diff --git a/Dioxus.toml b/Dioxus.toml index b99cf59..2e07cb6 100644 --- a/Dioxus.toml +++ b/Dioxus.toml @@ -31,7 +31,7 @@ watch_path = ["src", "assets"] # CSS style file -style = ["/tailwind.css"] +style = ["/styles/tailwind_output.css"] # Javascript code file script = [] diff --git a/assets/styles/.gitignore b/assets/styles/.gitignore index ddeb771..c63c213 100644 --- a/assets/styles/.gitignore +++ b/assets/styles/.gitignore @@ -1 +1 @@ -tailwind_output.css +/tailwind_output.css diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 3b90249..43b704f 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -9,7 +9,6 @@ services: - /srv/app/.dioxus/ - /srv/app/dist/ - /srv/app/debug/ - - /srv/app/docker/ - /srv/app/node_modules/ - /srv/app/static/ - /srv/app/target/ diff --git a/docker/dev/app/Dockerfile b/docker/dev/app/Dockerfile index f992884..209098d 100644 --- a/docker/dev/app/Dockerfile +++ b/docker/dev/app/Dockerfile @@ -2,11 +2,13 @@ FROM rust:1.80-bookworm RUN rustup target add wasm32-unknown-unknown RUN cargo install dioxus-cli diesel_cli -RUN apt-get update && apt-get install -y nodejs npm +RUN apt-get update && apt-get install -y nodejs npm supervisor COPY . /srv/app WORKDIR /srv/app RUN npm install -CMD npm run watch & dx serve --port 8000 +COPY docker/dev/app/supervisord.conf /etc/supervisor/conf.d/supervisord.conf + +CMD ["supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] diff --git a/docker/dev/app/supervisord.conf b/docker/dev/app/supervisord.conf new file mode 100644 index 0000000..938f860 --- /dev/null +++ b/docker/dev/app/supervisord.conf @@ -0,0 +1,23 @@ +[supervisord] +nodaemon=true +logfile=/dev/null +logfile_maxbytes=0 +pidfile=/dev/null + +[program:npm] +command=npm run watch +directory=/srv/app +autostart=true +autorestart=true +stdout_logfile=/dev/fd/1 +stdout_logfile_maxbytes=0 +redirect_stderr=true + +[program:dx] +command=dx serve --port 8000 +directory=/srv/app +autostart=true +autorestart=true +stdout_logfile=/dev/fd/1 +stdout_logfile_maxbytes=0 +redirect_stderr=true