Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.git
vendor
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"intelephense.environment.phpVersion": "8.1.0"
}
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
24 changes: 24 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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" ]
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
13 changes: 13 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -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