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..11c9504 100644 --- a/README.md +++ b/README.md @@ -14,22 +14,26 @@ To run the site: ### Setup with Docker -To run the website with Docker, create a `Dockerfile` with the following content: +To run the website using Docker, follow these steps: -```dockerfile -FROM php:8.1-apache -RUN a2enmod proxy && a2enmod rewrite -COPY etc/000-default.conf /etc/apache2/sites-available/000-default.conf +Use the provided `Dockerfile` and `docker-compose.yml` to build and start the containers. Execute the following command: +```sh +docker compose up ``` -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` +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 new file mode 100644 index 0000000..a142554 --- /dev/null +++ b/compose.yml @@ -0,0 +1,11 @@ +version: '3.8' + +services: + php: + build: . + container_name: php-apache + ports: + - "${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