Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]: Add docker setup and an updated README for people who want to contribute #260

Merged
merged 6 commits into from
Jan 28, 2024
Merged
Show file tree
Hide file tree
Changes from 2 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
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,4 @@ Documentation
* [Events](doc/events.md)
* [Examples](doc/examples.md)
* [Caveats](doc/caveats.md)
* [Contributing](doc/contributing.md)
26 changes: 26 additions & 0 deletions doc/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Contributing
This is for people who want to contribute to the project.

## How to get started

First of all, you need to fork the repository and clone it locally.
After that, we've prepared a docker setup to help you get started quickly.

Install docker and docker-compose on your machine, then run the following commands:

```bash
docker-compose up -d
alexislefebvre marked this conversation as resolved.
Show resolved Hide resolved
docker-compose exec php-fpm bash
alexislefebvre marked this conversation as resolved.
Show resolved Hide resolved
```

When you are on the container, you can install the dependencies with composer:
alexislefebvre marked this conversation as resolved.
Show resolved Hide resolved

```bash
composer install
alexislefebvre marked this conversation as resolved.
Show resolved Hide resolved
```

Now you can execute the tests with the following command:

```bash
./vendor/bin/phpunit
alexislefebvre marked this conversation as resolved.
Show resolved Hide resolved
```
33 changes: 33 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
version: '3.1'
services:
mariadb:
image: 'mariadb:11.0'
working_dir: /application
volumes:
- '.:/application'
environment:
- MYSQL_ROOT_PASSWORD=root
- MYSQL_DATABASE=acme
- MYSQL_USER=root
- MYSQL_PASSWORD=root
ports:
- '11003:3306'

postgres:
image: 'postgres:15-alpine'
working_dir: /application
volumes:
- '.:/application'
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=postgres
- POSTGRES_DB=postgres
ports:
- '11004:5432'

php-fpm:
build: phpdocker/php-fpm
working_dir: /application
volumes:
- '.:/application'
- './phpdocker/php-fpm/php-ini-overrides.ini:/etc/php/8.3/fpm/conf.d/99-overrides.ini'
10 changes: 10 additions & 0 deletions phpdocker/php-fpm/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
FROM phpdockerio/php:8.3-fpm
alexislefebvre marked this conversation as resolved.
Show resolved Hide resolved
WORKDIR "/application"

RUN apt-get update \
&& apt-get -y --no-install-recommends install \
php8.3-mysql \
php8.3-pgsql \
php8.3-sqlite3 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/doc/*
alexislefebvre marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 2 additions & 0 deletions phpdocker/php-fpm/php-ini-overrides.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
upload_max_filesize = 100M
alexislefebvre marked this conversation as resolved.
Show resolved Hide resolved
post_max_size = 108M
6 changes: 3 additions & 3 deletions tests/AppConfigMysql/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
doctrine:
dbal:
driver: pdo_mysql
host: 127.0.0.1
port: null
host: mariadb
port: 3306
dbname: acme
user: root
password: ""
password: root
6 changes: 3 additions & 3 deletions tests/AppConfigPgsql/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
doctrine:
dbal:
driver: pdo_pgsql
host: 127.0.0.1
host: postgres
port: 5432
dbname: postgres
user: postgres
password: postgres
user: root
password: root
Loading