From 9022ead6502d2d4f274a46acdb88b95fb6b47a8e Mon Sep 17 00:00:00 2001 From: SerhiiCho Date: Wed, 18 Jun 2025 10:14:45 +0300 Subject: [PATCH 1/3] chore: add vscode settings --- .vscode/settings.json | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .vscode/settings.json diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..f0aaaf7 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,3 @@ +{ + "intelephense.environment.phpVersion": "8.1.0" +} \ No newline at end of file From 48d0cd25dd9d21b9b48cbcdf90977cfe8e7e4f1b Mon Sep 17 00:00:00 2001 From: SerhiiCho Date: Wed, 18 Jun 2025 10:16:07 +0300 Subject: [PATCH 2/3] docs: update changelog and readme.md --- CHANGELOG.md | 3 +++ README.md | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 95d7801..9ebdf8c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Release Notes +## v4.1.0 (2025-06-18) +💻 Added Docker to the project + ## v4.0.1 (2025-01-18) - 🐛 Bug fix with incorrect days in a year diff --git a/README.md b/README.md index 9eb1f71..feffe5a 100644 --- a/README.md +++ b/README.md @@ -27,3 +27,20 @@ composer require serhii/ago ## License The Ago project is licensed under the [MIT License](https://github.com/php-ago/ago/blob/master/LICENSE) + +## Development +### Without Docker +You'll need to have Composer and PHP installed on your machine + +### Docker +#### Build an image +To build an image, navigate to the root of project that contains `Dockerfile` and run this command: +```bash +docker compose build app +``` + +#### Run the container +To run the container, navigate to the root of project that contains `Dockerfile` and run this command: +```bash +docker compose run --rm app +``` \ No newline at end of file From d4da3edde5daefd15562c0b17772f70e443e34c3 Mon Sep 17 00:00:00 2001 From: SerhiiCho Date: Wed, 18 Jun 2025 13:47:55 +0300 Subject: [PATCH 3/3] feat: add docker to project --- .dockerignore | 2 ++ Dockerfile | 24 ++++++++++++++++++++++++ docker-compose.yml | 13 +++++++++++++ 3 files changed, 39 insertions(+) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 docker-compose.yml diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..d23b55d --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +.git +vendor \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..5efcad7 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM php:8.1-cli + +# unzip and git are needed for composer to run +RUN apt-get update && apt-get install -y \ + unzip \ + git \ + && rm -rf /var/lib/apt/lists/* + +# Install Composer binary +COPY --from=composer:latest /usr/bin/composer /usr/bin/composer + +WORKDIR /app + +# Copy composer files first for better cache usage +COPY composer.json composer.lock* ./ + +# Install all the dependencies and clear cache +RUN composer install --no-interaction --prefer-dist --no-progress && \ + composer clear-cache + +# Copy the rest of the application +COPY . . + +ENTRYPOINT [ "bash" ] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 0000000..08b0631 --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,13 @@ +name: php-serhii-ago + +services: + app: + build: + context: . + image: php-serhii-ago + volumes: + - .:/app + environment: + - TERM=xterm-256color + tty: true + stdin_open: true