-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #73 from Trusted97/feat/add-docker-enviroment
feat: add docker enviroment
- Loading branch information
Showing
8 changed files
with
83 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# Contributing | ||
|
||
## Quick Guide | ||
|
||
1. [Fork](https://help.github.com/articles/fork-a-repo/) this repository to your own GitHub account and then [clone](https://help.github.com/articles/cloning-a-repository/) it to your local machine. | ||
2. Install the dependencies (`composer install --dev`) | ||
3. Create a new branch (`git checkout -b feat/new-feature`) | ||
4. Write your feature or fix and make sure tests pass and code standards are met (see below) | ||
5. Commit your changes (`git commit -m 'feat(new-feature): some feature or fix'`) | ||
6. Push to the branch (`git push origin feat/new-feature`) | ||
7. Open a pull request | ||
|
||
## Working with Docker 🐳 | ||
|
||
This project provides a Docker setup that allows working on it using any of the supported PHP versions. | ||
|
||
To use it, you first need to install: | ||
|
||
* [Docker](https://docs.docker.com/get-docker/) | ||
* [Docker Compose](https://docs.docker.com/compose/install/) | ||
|
||
Make sure the versions installed support [Compose file format 3.9](https://docs.docker.com/compose/compose-file/). | ||
|
||
You can then build the images: | ||
|
||
```console | ||
docker compose up --build -d | ||
``` | ||
|
||
Now you can run commands needed to work on the project. For example, say you want to install the dependencies on PHP 8.0: | ||
|
||
```console | ||
docker-compose run codice-fiscale-php-80 composer install | ||
``` | ||
|
||
or for enter the container | ||
|
||
```console | ||
docker-compose exec codice-fiscale-php-80 sh | ||
``` | ||
|
||
## Testing | ||
|
||
To run the test use the command below: | ||
|
||
```bash | ||
composer test | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -334,7 +334,7 @@ Test | |
---- | ||
|
||
``` bash | ||
$ vendor\bin\phpunit | ||
$ composer test | ||
``` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -334,7 +334,7 @@ Test | |
---- | ||
|
||
``` bash | ||
$ vendor\bin\phpunit | ||
$ composer test | ||
``` | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: '3.9' | ||
|
||
services: | ||
codice-fiscale-71: | ||
build: docker/php-7.1 | ||
container_name: codice-fiscale-php-71 | ||
working_dir: /app | ||
tty: true | ||
volumes: | ||
- .:/app:cached | ||
|
||
codice-fiscale-80: | ||
build: docker/php-8.0 | ||
container_name: codice-fiscale-php-80 | ||
working_dir: /app | ||
tty: true | ||
volumes: | ||
- .:/app:cached |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM php:7.1-alpine3.9 | ||
|
||
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
FROM php:8.0-cli-alpine3.16 | ||
|
||
COPY --from=composer:latest /usr/bin/composer /usr/local/bin/composer |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters