From a6dc35e736781bce72df3b8ea13ca99a393d1d33 Mon Sep 17 00:00:00 2001 From: Kevin Yen Date: Tue, 2 Sep 2025 23:10:45 -0700 Subject: [PATCH 1/6] docs: add section on development setup --- README.md | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/README.md b/README.md index 0e087a0..8114d85 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,19 @@ This is the MAGLab website source code and a work in progress. Also, the readme is a work in progress. +## Development Setup + +Prerequisites +* PHP + +```bash +cp home/protected/maglab/config/config.php.example home/protected/maglab/config/config.php +cd home/public +php -S localhost:8000 +``` + +Visit the home page at http://localhost:8000/MainApp.php + ## TODO * Write Deployment Instructions From 2106db8c3568bb1b6bdb693b71b6e4f13933966d Mon Sep 17 00:00:00 2001 From: Kevin Yen Date: Tue, 16 Sep 2025 22:29:07 -0700 Subject: [PATCH 2/6] build: add Dockerfile --- Dockerfile | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..8882b78 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,7 @@ +FROM php:8.4.12-apache + +RUN a2enmod rewrite + +COPY home/public/ /var/www/html/ +COPY home/protected/ /var/www/protected/ +COPY home/conf/ /var/www/conf/ From a84c1bcefdca7b685968a8aed35f6a90cfba1005 Mon Sep 17 00:00:00 2001 From: Kevin Yen Date: Tue, 16 Sep 2025 22:32:54 -0700 Subject: [PATCH 3/6] docs: update instructions to use Docker --- README.md | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8114d85..2eafbd0 100644 --- a/README.md +++ b/README.md @@ -6,15 +6,14 @@ Also, the readme is a work in progress. ## Development Setup Prerequisites -* PHP +* Docker ```bash -cp home/protected/maglab/config/config.php.example home/protected/maglab/config/config.php -cd home/public -php -S localhost:8000 +docker build -t maglaboratory/website . +docker run -p 8000:80 maglaboratory/website ``` -Visit the home page at http://localhost:8000/MainApp.php +Visit the home page at http://localhost:8000 ## TODO * Write Deployment Instructions From 7702935688d0e1920f37cb95fe08e830c144e9d1 Mon Sep 17 00:00:00 2001 From: Kevin Yen Date: Tue, 16 Sep 2025 22:43:44 -0700 Subject: [PATCH 4/6] build: allow for mounting of local folder as volume --- Dockerfile | 10 +++++++--- README.md | 8 +++++++- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8882b78..6ea069e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,7 +1,11 @@ FROM php:8.4.12-apache +COPY . /website + +ENV APACHE_DOCUMENT_ROOT /website/home/public +RUN sed -ri -e 's!/var/www/html!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/sites-available/*.conf +RUN sed -ri -e 's!/var/www/!${APACHE_DOCUMENT_ROOT}!g' /etc/apache2/apache2.conf /etc/apache2/conf-available/*.conf + RUN a2enmod rewrite -COPY home/public/ /var/www/html/ -COPY home/protected/ /var/www/protected/ -COPY home/conf/ /var/www/conf/ +WORKDIR /website diff --git a/README.md b/README.md index 2eafbd0..c00001d 100644 --- a/README.md +++ b/README.md @@ -10,11 +10,17 @@ Prerequisites ```bash docker build -t maglaboratory/website . -docker run -p 8000:80 maglaboratory/website +docker run -p 8000:80 -v $(pwd):/website --name website --rm maglaboratory/website ``` Visit the home page at http://localhost:8000 +To rebuild the site, run + +```bash +docker exec website php -f src/compile.php +``` + ## TODO * Write Deployment Instructions From 52da5a6fb9d2b81414e909ab235954d7c37e994a Mon Sep 17 00:00:00 2001 From: Kevin Yen Date: Tue, 16 Sep 2025 23:09:02 -0700 Subject: [PATCH 5/6] build: use PHP 7 to avoid deprecation warnings --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 6ea069e..92002f3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM php:8.4.12-apache +FROM php:7.4.33-apache COPY . /website From f06f4d7bdebd3062d0994d32fbb5b5e1cbea1089 Mon Sep 17 00:00:00 2001 From: Kevin Yen Date: Tue, 16 Sep 2025 23:43:23 -0700 Subject: [PATCH 6/6] refactor: preconnect Google Fonts, use webp for images --- home/protected/maglab/app/views/board/add.php | 10 ++++++---- home/protected/maglab/app/views/board/edit.php | 10 ++++++---- home/protected/maglab/app/views/board/index.php | 10 ++++++---- .../protected/maglab/app/views/board/noEdit.php | 10 ++++++---- home/protected/maglab/app/views/board/show.php | 10 ++++++---- .../maglab/app/views/emails/job_board.php | 2 +- home/protected/maglab/app/views/hal/chart.php | 10 ++++++---- home/protected/maglab/app/views/hal/index.php | 10 ++++++---- .../maglab/app/views/main/class_deposit.php | 10 ++++++---- .../maglab/app/views/main/community.php | 10 ++++++---- home/protected/maglab/app/views/main/donate.php | 10 ++++++---- .../maglab/app/views/main/homepage.php | 10 ++++++---- .../maglab/app/views/main/membership.php | 10 ++++++---- .../maglab/app/views/main/pay4keyed.php | 10 ++++++---- home/public/css/maglab.css | 2 +- home/public/images/email-logo.webp | Bin 0 -> 40918 bytes home/public/images/entrance-flags.webp | Bin 0 -> 71110 bytes home/public/images/entrance-sign.webp | Bin 0 -> 98602 bytes home/public/images/logo.webp | Bin 0 -> 40918 bytes home/public/images/social-icons.webp | Bin 0 -> 3632 bytes src/scss/pages/_homepage.scss | 2 +- src/views/board.layout.haml | 10 ++++++---- src/views/emails.layout.haml | 2 +- src/views/hal.layout.haml | 10 ++++++---- src/views/main.layout.haml | 10 ++++++---- 25 files changed, 100 insertions(+), 68 deletions(-) create mode 100644 home/public/images/email-logo.webp create mode 100644 home/public/images/entrance-flags.webp create mode 100644 home/public/images/entrance-sign.webp create mode 100644 home/public/images/logo.webp create mode 100644 home/public/images/social-icons.webp diff --git a/home/protected/maglab/app/views/board/add.php b/home/protected/maglab/app/views/board/add.php index 9c91c23..d56ce8c 100644 --- a/home/protected/maglab/app/views/board/add.php +++ b/home/protected/maglab/app/views/board/add.php @@ -14,7 +14,9 @@ - + +> +