-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
david_smith
committed
Jan 14, 2025
1 parent
48a079d
commit f84f9d7
Showing
3 changed files
with
62 additions
and
58 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
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,60 @@ | ||
# Local Development | ||
|
||
## Contents | ||
|
||
- [Introduction](#introduction) | ||
- [Prerequisites](#prerequisites) | ||
- [Initializing](#initializing) | ||
- [Testing](#testing) | ||
- [Configuration](#configuration) | ||
|
||
## Introduction | ||
|
||
This project provides a convenient [dock](https://github.com/zero-to-prod/dock) script to simplify local development workflows within Docker | ||
containers. | ||
|
||
You can use this script to initialize the project, manage Composer dependencies, and run tests in a consistent PHP environment. | ||
|
||
## Prerequisites | ||
|
||
- Docker installed and running | ||
- A `.env` file (created automatically via the `dock init` command, if it doesn’t already exist) | ||
|
||
## Initializing | ||
|
||
Use the following commands to set up the project: | ||
|
||
```shell | ||
sh dock init | ||
sh dock composer update | ||
``` | ||
|
||
## Testing | ||
|
||
This command runs PHPUnit inside the Docker container, using the PHP version specified in your `.env` file. | ||
You can modify or extend this script to include additional tests or commands as needed. | ||
|
||
```shell | ||
sh dock test | ||
``` | ||
|
||
Run the test suite with all versions of php: | ||
|
||
```shell | ||
sh test.sh | ||
``` | ||
|
||
## Configuration | ||
|
||
Before starting development, verify that your `.env` file contains the correct settings. | ||
|
||
You can specify which PHP version to use for local development, debugging, and Composer operations by updating these variables in your `.env` file: | ||
|
||
```dotenv | ||
PHP_VERSION=8.1 | ||
PHP_DEBUG=8.1 | ||
PHP_COMPOSER=8.1 | ||
``` | ||
|
||
Make sure these values reflect the PHP versions you intend to use. | ||
If the `.env` file does not exist, run the `sh dock init` command to create one from the `.env.example` template. |
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