You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
| Service |[Caddy Server](https://caddyserver.com/)| Open source web server with automatic HTTPS written in Go |
52
+
| Service |[Supervisor](http://supervisord.org/)| Supervisor is a client/server system that allows its users to control a number of processes on UNIX-like operating systems.|
52
53
| Service |[PHP-FPM](https://www.php.net/manual/en/install.fpm.php)| PHP with FastCGI Process Manager |
53
54
| Miscelaneous |[Bash](https://www.gnu.org/software/bash/)| Allows to create an interactive shell within containerized service |
54
55
| Miscelaneous |[Make](https://www.gnu.org/software/make/)| Allows to execute commands defined on a _Makefile_|
@@ -59,313 +60,71 @@ To use this repository you need:
59
60
60
61
61
62
62
-
## Getting Started
63
-
64
-
Just clone the repository into your preferred path:
`Dockerfile` is based on [multi-stage builds](https://docs.docker.com/build/building/multi-stage/) in order to simplify the process to generate the **development container image** and the optimized **production-ready container image**.
A custom health check script is provided to check the container service by performing a `PHP-FPM``ping/pong` check.
110
-
111
-
You can find this shell script at `build/healthcheck.sh`.
112
-
113
-
114
-
115
-
> [!NOTE]
116
-
>
117
-
> Review the `Dockerfile` file and adjust the `HEALTHCHECK` directive options accordingly.
63
+
## Development Environment
118
64
119
65
120
66
121
67
> [!IMPORTANT]
122
68
>
123
-
> Remember to rebuild the Docker image if you make any change on this file.
124
-
125
-
126
-
127
-
##### Non-Privileged User
128
-
129
-
Current container service uses a **non-privileged user** to execute `PHP-FPM`, with same User/Group ID than the host user.
130
-
131
-
This mechanism allows to `PHP-FPM` create/update shared resources within the host with the same credentials than current host user, avoiding possible file-permissions issues.
132
-
133
-
To create this user in the container service, current host user details are collected in the `Makefile` and passed to Docker `build` command as arguments:
134
-
135
-
| Argument | Default value | Required value | Description |
|`HOST_USER_NAME`| host-user-name |`$ id --user --name`| Current host user name |
138
-
|`HOST_GROUP_NAME`| host-group-name |`$ id --group --name`| Current host group name |
139
-
|`HOST_USER_ID`| 1001 |`$ id --user`| Current host user ID |
140
-
|`HOST_GROUP_ID`| 1001 |`$ id --group`| Current host user group ID |
141
-
142
-
143
-
144
-
> [!NOTE]
69
+
> This development environment is based on [Dockerized PHP](https://github.com/alcidesrc/dockerized-php), a framework agnostic *dockerized* environment to create and deploy PHP applications.
145
70
>
146
-
> Review the `Makefile` and `Dockerfile` files and adjust the arguments to your convenience.
71
+
> Please take a look to the [README.md](https://github.com/alcidesrc/dockerized-php/blob/main/README.md) file to know how to familiarize with it and get up and running.
147
72
148
73
149
74
150
75
> [!IMPORTANT]
151
76
>
152
-
> Remember to rebuild the Docker image if you make any change on `Dockerfile` file.
153
-
154
-
155
-
156
-
#### Logging
157
-
158
-
The container service logs to `STDOUT` by default.
159
-
160
-
#### Project Structure
161
-
162
-
```text
163
-
├── build # Docker-related configuration files
164
-
│ ├── Caddyfile # Caddy's configuration file
165
-
│ ├── healthcheck.sh # Shell script for Docker's HEALTHCHECK directive
166
-
│ ├── www.conf # PHP-FPM configuration file
167
-
│ └── xdebug.ini # xDebug configuration file
168
-
├── coverage # Code Coverage HTML report target folder
169
-
├── src # PHP application folder
170
-
├── caddy-root-ca-authority.crt # Generated certificate file with Caddy Root CA Authority details
171
-
├── docker-compose.yml
172
-
├── Dockerfile
173
-
├── Makefile
174
-
└── README.md # This file
175
-
```
176
-
177
-
##### Volumes
178
-
179
-
There are some volumes created between the *host* and the container service:
|`./coverage`|`/coverage`| Code Coverage HTML report target folder |
185
-
186
-
187
-
188
-
> [!NOTE]
77
+
> Default application is based on [PHP Skeleton](https://github.com/alcidesrc/php-skeleton), a minimalistic boilerplate to create PHP applications from scratch.
189
78
>
190
-
> Review the `docker-compose.yml` and volumes to your convenience.
191
-
79
+
> Please take a look to the [README.md](https://github.com/alcidesrc/php-skeleton/blob/main/README.md) file to know how to familiarize with it and get up and running.
192
80
193
81
194
-
> [!IMPORTANT]
195
-
>
196
-
> Remember to restart the container service if you make any change in `docker-compose.yml`.
197
82
83
+
------
198
84
199
85
200
86
201
-
##### Available Commands
87
+
##Getting Started
202
88
203
-
A *Makefile* is provided with following commands:
89
+
Just clone the repository into your preferred path:
You can generate/register the **Caddy Authority Certificate** in order to get `SSL` support .
265
-
266
-
267
-
268
-
> [!NOTE]
269
-
>
270
-
> Just execute `make install-caddy-certificate` and follow the provided guidelines to generate the Caddy Authority Certificate and install it on your host.
271
-
272
-
273
-
274
-
> [!IMPORTANT]
275
-
>
276
-
> Remember to reinstall the certificate if you rebuild the container service.
277
-
278
-
279
-
280
-
281
-
#### PHP Application
282
-
283
-
PHP application must be placed into `src` folder.
284
-
285
-
286
-
287
-
> [!TIP]
288
-
>
289
-
> There are some `Makefile` commands that allows you to install a [PHP Skeleton](https://github.com/fonil/php-skeleton) as boilerplate or [Laravel](https://github.com/laravel/laravel) when creating `PHP` applications from scratch.
290
-
291
96
292
97
293
-
##### Testing
294
-
295
-
###### Mocking Date/Time functions
296
-
297
-
Testing with date and/or time variations sometimes can be a nightmare. To assist on this topic the **UOPZ** extension has been installed and enabled by default.
298
-
299
-
300
-
301
-
> [!TIP]
302
-
>
303
-
> You can use [slope-it/clock-mock](https://github.com/slope-it/clock-mock) as a development dependency when mocking date/time functions.
@@ -385,7 +144,7 @@ Only the latest major version receives security fixes.
385
144
386
145
### Reporting a Vulnerability
387
146
388
-
If you discover a security vulnerability within this project, please [open an issue here](https://github.com/fonil/dockerized-php/issues). All security vulnerabilities will be promptly addressed.
147
+
If you discover a security vulnerability within this project, please [open an issue here](https://github.com/alcidesrc/dockerized-php-supervisor/issues). All security vulnerabilities will be promptly addressed.
0 commit comments