-
-
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.
build(Dockerfile): standarize the way images are built
- Loading branch information
Alcides Ramos
committed
Oct 5, 2024
1 parent
0bf4c86
commit 496826e
Showing
8 changed files
with
169 additions
and
106 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
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 |
---|---|---|
|
@@ -14,22 +14,15 @@ | |
|
||
## Summary | ||
|
||
This repository contains a _dockerized_ environment for building PHP applications based on **php:8.3.10-fpm-alpine** with Caddy support. | ||
This repository contains a _dockerized_ environment for building PHP applications based on **php:8.3.12-fpm-alpine** with Caddy support. | ||
|
||
### Highlights | ||
|
||
- Unified environment to build <abbr title="Command Line Interface">CLI</abbr>, <u>web applications</u> and/or <u>micro-services</u> based on **PHP8**. | ||
- Allows you to create an optimized **development environment** Docker image | ||
- Allows you to create an optimized **production-ready** Docker image | ||
- Using **Caddy** web server. | ||
- PHP application is loaded into Caddy as a module. | ||
|
||
### Infrastructure | ||
|
||
| Docker Infrastructure | Value | Size | | ||
| --------------------- | ----- | ----- | | ||
| Containers | 1 | 201Mb | | ||
| Services | 1 | N/A | | ||
- Multi-stage Dockerfile to allows you to create an optimized **development** or **production-ready** Docker images | ||
- Uses **Caddy webserver**. | ||
- PHP-FPM is **managed by Caddy**. | ||
- **Everything in one single Docker service**. | ||
|
||
|
||
|
||
|
@@ -44,7 +37,7 @@ To use this repository you need: | |
- [Docker](https://www.docker.com/) - An open source containerization platform. | ||
- [Git](https://git-scm.com/) - The free and open source distributed version control system. | ||
- [Make](https://www.gnu.org/software/make/) - A command to automate the build/manage process. | ||
|
||
- [jq](https://jqlang.github.io/jq/download/) - A lightweight and flexible command-line JSON processor. | ||
|
||
|
||
------ | ||
|
@@ -53,14 +46,15 @@ To use this repository you need: | |
|
||
## Built with | ||
|
||
| Type | Component | Description | | ||
| -------------- | ------------------------------------------------------------ | ------------------------------------------------------------ | | ||
| Infrastructure | [Docker](https://www.docker.com/) | Containerization platform | | ||
| Type | Component | Description | | ||
| -------------- | -------------------------------------------------------- | ------------------------------------------------------------ | | ||
| Infrastructure | [Docker](https://www.docker.com/) | Containerization platform | | ||
| Service | [Caddy Server](https://caddyserver.com/) | Open source web server with automatic HTTPS written in Go | | ||
| Service | [Caddy Supervisor](https://github.com/baldinof/caddy-supervisor) | A module to run and supervise background processes from Caddy | | ||
| Service | [PHP-FPM](https://www.php.net/manual/en/install.fpm.php) | PHP with FastCGI Process Manager | | ||
| Miscelaneous | [Bash](https://www.gnu.org/software/bash/) | Allows to create an interactive shell within containerized service | | ||
| Miscelaneous | [Make](https://www.gnu.org/software/make/) | Allows to execute commands defined on a _Makefile_ | | ||
| Service | [PHP-FPM](https://www.php.net/manual/en/install.fpm.php) | PHP with FastCGI Process Manager | | ||
| Miscelaneous | [Bash](https://www.gnu.org/software/bash/) | Allows to create an interactive shell within containerized service | | ||
| Miscelaneous | [Make](https://www.gnu.org/software/make/) | Allows to execute commands defined on a _Makefile_ | | ||
| Miscelaneous | [jq](https://jqlang.github.io/jq/download/) | Allows to beautify the Docker inspections in JSON format | | ||
|
||
|
||
|
||
|
@@ -101,41 +95,39 @@ $ mkdir -p ~/path/to/my-new-project && cd ~/path/to/my-new-project | |
$ git clone [email protected]:alcidesrc/dockerized-php-caddy.git . | ||
``` | ||
|
||
### Quickstart | ||
|
||
```bash | ||
$ make init | ||
``` | ||
|
||
### TL;DR | ||
|
||
### Building the container | ||
#### Building the container | ||
|
||
```bash | ||
$ make build | ||
``` | ||
|
||
### Starting the container service | ||
#### Starting the container service | ||
|
||
```bash | ||
$ make up | ||
``` | ||
|
||
### Extracting Caddy Local Authority - 20XX ECC Root | ||
#### Extracting Caddy Local Authority - 20XX ECC Root | ||
|
||
```bash | ||
$ make extract-caddy-certificate | ||
$ make install-caddy-certificate | ||
``` | ||
|
||
|
||
|
||
> [!WARNING] | ||
> | ||
> Just follow the instructions provided in order to properly install the certificate into your preferred browser. | ||
|
||
|
||
### Accessing to web application | ||
#### Accessing to web application | ||
|
||
```bash | ||
$ xdg-open https://website.localhost | ||
$ make open-website | ||
``` | ||
|
||
### Stopping the container service | ||
#### Stopping the container service | ||
|
||
```bash | ||
$ make down | ||
|
Oops, something went wrong.