Skip to content

Commit a31cd8a

Browse files
Update README.md
1 parent 62637f6 commit a31cd8a

File tree

1 file changed

+29
-32
lines changed

1 file changed

+29
-32
lines changed

README.md

+29-32
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<p align="center">
22
<img width="520px" src="https://user-images.githubusercontent.com/16992394/65461542-697e1300-de54-11e9-8e4f-34adcc448747.png">
33
</p>
4-
<h2 align="center">🐳 An extendable multistage PHP Symfony 4.3+ Docker Image for Production and Development</h2>
5-
<p align="center">A Base Template Image to be added to your Symfony Application.</p>
4+
<h2 align="center">🐳 An preconfigured, extendable, multistage, PHP Symfony 4.3+ Docker Image for Production and Development</h2>
5+
<p align="center">.</p>
66
<p align="center">
77
<a>
88
<img src="https://img.shields.io/github/v/tag/sherifabdlnaby/symdocker?label=release&amp;sort=semver">
@@ -28,37 +28,24 @@
2828
</p>
2929

3030
# Introduction
31-
**Docker Image for Symfony 4.3+ Application** running on **Nginx + PHP_FPM** based on [PHP Official Image](https://hub.docker.com/_/php).
32-
This image should be used as a **base** image for your Symfony Project, **and you shall extend and edit it according to your app needs.**
33-
The Image utilizes docker's multistage builds to create multiple targets optimized for **production** and **development**.
31+
**Docker Image for Symfony 4.3+ Application** running **Nginx + PHP FPM** based on [PHP](https://hub.docker.com/_/php) & [Nginx](https://hub.docker.com/_/nginx) **Alpine Official Images**.
3432

33+
This is a pre-configured template image for your Symfony Project, **and you shall extend and edit it according to your app requirements.**
34+
The Image utilizes docker's multistage builds to create multiple targets optimized for **production** and **development**.
3535

3636
You should copy this repository`Dockerfile`, `docker` Directory, `Makefile`, and `.dockerignore` to your Symfony application repository and configure it to your needs.
3737

3838
### Main Points 📜
3939

40-
- **Production Image is a fully contained Image with source code and dependencies inside**, Development image is set up for mounting source code on runtime with hot-reload.
40+
- **Production Images is a fully contained Image with source code and dependencies inside**, Development image is set up for mounting source code on runtime with hot-reload.
4141

42-
- Image configuration is transparent, you can view and modify any of the configurations that determine the behavior of the application.
42+
- Image configuration is transparent, all configuration and default configurations that determine app behavior are present in the image directory.
4343

4444
- Nginx **HTTP**, **HTTPS**, and **HTTP2** are pre-configured, for **HTTPS** it uses self-signed certificate generated at build-time. For production you'll need to mount your own signed certificates to `/etc/nginx/ssl` amd overwrite defaults.
4545

4646
- Image tries to fail at build time as much as possible by running all sort of Checks.
4747

48-
- Dockerfile is arranged for optimize builds, so that changed won't invalidate cache as much as possible.
49-
50-
### Image Targets
51-
52-
| **Target** | **Description** | **Size** | **Stdout** | **Targets** |
53-
|-------------- |---------------------------------------------------------------------------------------------------- |-------------- |:----------------------------: |:-----------------------------------: |
54-
| `nginx` | The Webserver, serves static content and replay others requests `php-fpm` | 21 MB | Nginx Access and Error logs. | `nginx-prod`, `nginx-dev` |
55-
| `fpm` | PHP_FPM, which will actually run the PHP Scripts for web requests. | 78 MB | PHP Application logs only. | `fpm-prod`, `fpm-dev` |
56-
| `supervisor` | Contains supervisor and source-code, for your consumers. (config at `docker/conf/supervisor/`) | 120 MB | Stdout of all Commands. | `supervisor-prod` |
57-
| `cron` | Loads crontab and your app source-code, for your cron commands. (config at `docker/conf/crontab`) | 78 MB | Stdout of all Crons. | `cron-prod` |
58-
59-
> All Images are **Alpine** based. Official PHP-Alpine-Cli image size is 79.4MB.
60-
61-
> Size stated above are calculated excluding source code and vendor directory.
48+
- Dockerfile is arranged for optimize prod builds, so that changes won't invalidate cache as much as possible.
6249

6350
-----
6451

@@ -71,27 +58,25 @@ You should copy this repository`Dockerfile`, `docker` Directory, `Makefile`, and
7158

7259
# Setup
7360

74-
### Get Template
75-
#### 1. Generate Repo from this Template
61+
#### 1. Add Template to your repo.
7662

7763
1. Download This Repository
7864
2. Copy `Dockerfile`, `docker` Directory, `Makefile`, and `.dockerignore` Into your Symfony Application Repository.
79-
3. Modify `Dockerfile` to your app needs, and add your app needed PHP Extensions and Required Packages.
80-
4. Situational:
81-
- If you will use `Makefile` and `Docker-Compose`: go to `docker/.composer/.env` and modify `SERVER_NAME` to your app's name.
82-
- If you will expose SSL port to Production: Mount your signed certificates `server.crt` & `server.key` to `/etc/nginx/ssl`.
83-
Also make sure `SERVER_NAME` build ARG matches Certificate's **Common Name**.
84-
5. run `make up` for development or `make deploy` for production.
8565

8666
OR
8767

8868
<a href="https://github.com/sherifabdlnaby/symdocker/generate">
8969
<img src="https://user-images.githubusercontent.com/16992394/65464461-20c95880-de5a-11e9-9bf0-fc79d125b99e.png" alt="create repository from template"></a>
9070

91-
<p> <small>And start from step 3..</small> </p>
71+
#### 2. Start
72+
1. Modify `Dockerfile` to your app needs, and add your app needed PHP Extensions and Required Packages.
73+
2. Go to `docker/.composer/.env` and modify `SERVER_NAME` to your app's name.
74+
3. Run `make up` for development or `make deploy` for production.
75+
76+
> Makefile is just a wrapper over docker-compose commands.
9277
9378
94-
# Building Image
79+
# Building and Extending Image
9580

9681
1. The image is to be used as a base for your Symfony application image, you should modify its Dockerfile to your needs.
9782

@@ -114,6 +99,19 @@ However in an environment where CI/CD pipelines will build the image, they will
11499
| `APP_ENV` | App Environment | - `prod` for Production image</br> - `dev` for Development image |
115100
| `APP_DEBUG` | Enable Debug | - `0` for Production image</br>- `1` for Development image |
116101

102+
### Image Targets
103+
104+
| **Target** | **Description** | **Size** | **Stdout** | **Targets** |
105+
|-------------- |---------------------------------------------------------------------------------------------------- |-------------- |:----------------------------: |:-----------------------------------: |
106+
| `nginx` | The Webserver, serves static content and replay others requests `php-fpm` | 21 MB | Nginx Access and Error logs. | `nginx-prod`, `nginx-dev` |
107+
| `fpm` | PHP_FPM, which will actually run the PHP Scripts for web requests. | 78 MB | PHP Application logs only. | `fpm-prod`, `fpm-dev` |
108+
| `supervisor` | Contains supervisor and source-code, for your consumers. (config at `docker/conf/supervisor/`) | 120 MB | Stdout of all Commands. | `supervisor-prod` |
109+
| `cron` | Loads crontab and your app source-code, for your cron commands. (config at `docker/conf/crontab`) | 78 MB | Stdout of all Crons. | `cron-prod` |
110+
111+
> All Images are **Alpine** based. Official PHP-Alpine-Cli image size is 79.4MB.
112+
113+
> Size stated above are calculated excluding source code and vendor directory.
114+
117115
## Tips for building Image in different environments
118116

119117
### Production
@@ -128,7 +126,6 @@ However in an environment where CI/CD pipelines will build the image, they will
128126

129127
----
130128

131-
132129
# Configuration
133130

134131
## 1. PHP Extensions, Dependencies, and Configuration

0 commit comments

Comments
 (0)