From 47cfd36ac0753052f77d386c13fe277a549fa0e1 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Mon, 15 Jul 2024 14:48:22 +0200 Subject: [PATCH 1/2] Docker: Describe and add Docker compose setup for local development --- .gitignore | 1 - Dockerfile | 5 +++++ README.md | 17 ++--------------- compose.yml | 11 +++++++++++ 4 files changed, 18 insertions(+), 16 deletions(-) create mode 100644 Dockerfile create mode 100644 compose.yml diff --git a/.gitignore b/.gitignore index 89ec1a2..eb3387c 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ webroot/download webroot/data/buildbot-status.json *.log *.pyc -Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..6c97fbf --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM php:8.1-apache + +RUN a2enmod proxy && a2enmod rewrite + +EXPOSE 80 \ No newline at end of file diff --git a/README.md b/README.md index 558dfa9..2ae9ce0 100644 --- a/README.md +++ b/README.md @@ -14,22 +14,9 @@ To run the site: ### Setup with Docker -To run the website with Docker, create a `Dockerfile` with the following content: - -```dockerfile -FROM php:8.1-apache -RUN a2enmod proxy && a2enmod rewrite -COPY etc/000-default.conf /etc/apache2/sites-available/000-default.conf -``` - -Then run: - -* `docker build . -t blender-buildbot-www` -* `docker run -d -p 80:80 --name blender-buildbot-www -v "$PWD":/var/www/html:ro blender-buildbot-www` - -Next time you need to start the container: -* `docker start blender-buildbot-www` +To run the website with Docker, use the included `Dockerfile` and `compose.yml`: +* `docker compose up -d --build` ## The download directory diff --git a/compose.yml b/compose.yml new file mode 100644 index 0000000..0536b74 --- /dev/null +++ b/compose.yml @@ -0,0 +1,11 @@ +version: '3.8' + +services: + php: + build: . + container_name: php-apache + ports: + - "80:80" + volumes: + - ./:/var/www/html + - ./etc/000-default.conf:/etc/apache2/sites-enabled/000-default.conf \ No newline at end of file -- 2.30.2 From 1861970d203514ad328bb1836d0533d99eb005e2 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Wed, 24 Jul 2024 13:02:36 +0200 Subject: [PATCH 2/2] Fix: Use port 8080 instead for local development --- README.md | 21 +++++++++++++++++++-- compose.yml | 2 +- 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 2ae9ce0..11c9504 100644 --- a/README.md +++ b/README.md @@ -14,9 +14,26 @@ To run the site: ### Setup with Docker -To run the website with Docker, use the included `Dockerfile` and `compose.yml`: +To run the website using Docker, follow these steps: -* `docker compose up -d --build` +Use the provided `Dockerfile` and `docker-compose.yml` to build and start the containers. Execute the following command: +```sh +docker compose up +``` + +Once the containers are up and running, you can access the website on port `8080`: +```sh +http://localhost:8080 +``` + +If you prefer to use a different port, you can override the default port by setting the `HOST_PORT` environment variable. For example, to use port `9090`, run: +```sh +HOST_PORT=9090 docker-compose up +``` +Then, access the website at: +```sh +http://localhost:9090 +``` ## The download directory diff --git a/compose.yml b/compose.yml index 0536b74..a142554 100644 --- a/compose.yml +++ b/compose.yml @@ -5,7 +5,7 @@ services: build: . container_name: php-apache ports: - - "80:80" + - "${HOST_PORT:-8080}:80" volumes: - ./:/var/www/html - ./etc/000-default.conf:/etc/apache2/sites-enabled/000-default.conf \ No newline at end of file -- 2.30.2