Skip to content

Commit

Permalink
Automatically rebuild javascript changes
Browse files Browse the repository at this point in the history
  • Loading branch information
dgarciabriseno committed Nov 8, 2023
1 parent 853c78b commit 1d95290
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
4 changes: 3 additions & 1 deletion compose/dockerfiles/webserver.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
FROM php:8.0.27-apache
RUN docker-php-ext-configure mysqli && docker-php-ext-install -j$(nproc) mysqli
RUN docker-php-ext-configure mysqli && docker-php-ext-install -j$(nproc) mysqli \
&& apt update \
&& apt install -y ant python3 inotify-tools

COPY ./compose/scripts/webserver_dev_mode.sh /root

Expand Down
12 changes: 9 additions & 3 deletions compose/scripts/webserver_dev_mode.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ set -e
sed -i "s|https://api.helioviewer.org|http://localhost:8081|" /var/www/html/resources/js/Utility/Config.js
sed -i "s|https://helioviewer.org|http://localhost:8080|" /var/www/html/resources/js/Utility/Config.js

apt update
apt install -y ant python3

cd /root
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
export NVM_DIR="$HOME/.nvm"
Expand All @@ -19,5 +16,14 @@ cd /var/www/html/resources/build
npm ci
ant

# Setup background process to rebuild js/css on change
rebuild_on_change() {
while [ true ]; do
inotifywait .. -e attrib -r
ant
done
}
rebuild_on_change &

source /etc/apache2/envvars
/usr/sbin/apache2 -DFOREGROUND

0 comments on commit 1d95290

Please sign in to comment.