1- # [ full stack nginx drupal for everyone with docker compose] ( https://github.com/damalis/full-stack-nginx-drupal-for-everyone-with-docker-compose )
1+ # [ full stack nginx Drupal for everyone with docker compose] ( https://github.com/damalis/full-stack-nginx-drupal-for-everyone-with-docker-compose )
22
3- If You want to have a drupal website at short time;
3+ If You want to build a website with Drupal at short time;
44
55#### Full stack Nginx Drupal:
6- <p align="left"> <a href="https://drupal.org/" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/docker-library/docs/e405066455691ca2429eb8094777f12d2dad8f91/drupal/logo.svg?sanitize=true" alt="drupal" height="40" width="40"/> </a> <a href="https://www.docker.com/" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/docker/docker.png" alt="docker" width="40" height="40" width="40"/> </a> <a href="https://mariadb.org/" target="_blank" rel="noreferrer"> <img src="https://avatars.githubusercontent.com/u/5877084?s=200&v=4" alt="mariadb" height="50" width="50"/> </a> <a href="https://www.nginx.com" target="_blank" rel="noreferrer"> <img src="https://avatars.githubusercontent.com/u/1412239?s=200&v=4" alt="nginx" height="40" width="40"/> </a> <a href="https://www.php.net" target="_blank" rel="noreferrer"> <img src="https://avatars.githubusercontent.com/u/25158?s=200&v=4" alt="php" height="40" width="40"/> </a> <a href="https://redis.io" target="_blank" rel="noreferrer"> <img src="https://avatars.githubusercontent.com/u/1529926?s=200&v=4" alt="redis" height="40" width="40"/> </a> <a href="https://www.varnish-software.com/" target="_blank" rel="noreferrer"> <img src="https://avatars.githubusercontent.com/u/577014?s=200&v=4" alt="varnish" height="40" width="40"/> </a> <a href="#" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/bash/bash.png" alt="Bash" height="50" width="50" /> </a>
6+ <p align="left"> <a href="https://drupal.org/" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/docker-library/docs/e405066455691ca2429eb8094777f12d2dad8f91/drupal/logo.svg?sanitize=true" alt="Drupal" height="40" width="40"/> </a> <a href="https://www.docker.com/" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/docker/docker.png" alt="docker" width="40" height="40" width="40"/> </a> <a href="https://mariadb.org/" target="_blank" rel="noreferrer"> <img src="https://avatars.githubusercontent.com/u/5877084?s=200&v=4" alt="mariadb" height="50" width="50"/> </a> <a href="https://www.nginx.com" target="_blank" rel="noreferrer"> <img src="https://avatars.githubusercontent.com/u/1412239?s=200&v=4" alt="nginx" height="40" width="40"/> </a> <a href="https://www.php.net" target="_blank" rel="noreferrer"> <img src="https://avatars.githubusercontent.com/u/25158?s=200&v=4" alt="php" height="40" width="40"/> </a> <a href="https://redis.io" target="_blank" rel="noreferrer"> <img src="https://avatars.githubusercontent.com/u/1529926?s=200&v=4" alt="redis" height="40" width="40"/> </a> <a href="#" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/bash/bash.png" alt="Bash" height="50" width="50" /> </a>
77 <a href =" https://www.phpmyadmin.net/ " target =" _blank " rel =" noreferrer " > <img src =" https://avatars.githubusercontent.com/u/1351977?s=200&v=4 " alt =" phpmyadmin " height =" 40 " width =" 40 " /> </a >  ;  ;  ; <a href =" https://letsencrypt.org/ " target =" _blank " rel =" noreferrer " > <img src =" https://avatars.githubusercontent.com/u/17889013?s=200&v=4 " alt =" letsencrypt " height =" 40 " width =" 40 " /> </a >  ;  ;  ; <a href =" https://www.portainer.io/?hsLang=en " target =" _blank " rel =" noreferrer " > <img src =" https://avatars.githubusercontent.com/u/22225832?s=200&v=4 " alt =" portainer " height =" 40 " width =" 40 " /> </a > </p >
88
99Plus, manage docker containers with Portainer.
1010
1111#### With this project you can quickly run the following:
1212
13- - [ drupal ( php-fpm) ] ( https://hub.docker.com/_/drupal )
13+ - [ Drupal ] ( https://hub.docker.com/_/ drupal) - [ php-fpm] ( https://hub.docker.com/_/php?tab=tags&page=1&name=fpm )
1414- [ webserver (nginx)] ( https://hub.docker.com/_/nginx )
1515- [ certbot (letsencrypt)] ( https://hub.docker.com/r/certbot/certbot )
1616- [ phpMyAdmin] ( https://hub.docker.com/r/phpmyadmin/phpmyadmin/ )
1717- [ database] ( https://hub.docker.com/_/mariadb )
1818- [ redis] ( https://hub.docker.com/_/redis )
19- - [ varnish] ( https://hub.docker.com/_/varnish )
2019- [ backup] ( https://hub.docker.com/r/futurice/docker-volume-backup )
2120
2221#### For certbot (letsencrypt) certificate:
@@ -35,15 +34,23 @@ Create rules to open ports to the internet, or to a specific IPv4 address or ran
3534
3635- [ Auto Configuration and Installation] ( #automatic )
3736- [ Requirements] ( #requirements )
38- - [ Configuration] ( #configuration )
39- - [ Installation] ( #installation )
37+ - [ Manual Configuration and Installation ] ( #manual )
38+ - [ Portainer Installation] ( #portainer )
4039- [ Usage] ( #usage )
40+ - [Website](#website)
41+ - [Webserver](#webserver)
42+ - [Database](#database)
43+ - [Redis](#redis)
44+ - [Cache](#cache)
45+ - [phpMyAdmin](#phpmyadmin)
46+ - [backup](#backup)
4147
4248## Automatic
4349
4450### Exec install shell script for auto installation and configuration
4551
4652download with
53+
4754```
4855git clone https://github.com/damalis/full-stack-nginx-drupal-for-everyone-with-docker-compose.git
4956```
@@ -67,7 +74,9 @@ Clone this repository or copy the files from this repository into a new folder.
6774
6875Make sure to [ add your user to the ` docker ` group] ( https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user ) .
6976
70- ## Configuration
77+ ## Manual
78+
79+ ### Configuration
7180
7281download with
7382```
@@ -80,8 +89,6 @@ Open a terminal and `cd` to the folder in which `docker-compose.yml` is saved an
8089cd full-stack-nginx-drupal-for-everyone-with-docker-compose
8190```
8291
83- ### Manual Configuration
84-
8592Copy the example environment into ` .env `
8693
8794```
@@ -102,17 +109,16 @@ cp ./phpmyadmin/apache2/sites-available/default-ssl.sample.conf ./phpmyadmin/apa
102109
103110change example.com to your domain name in ``` ./phpmyadmin/apache2/sites-available/default-ssl.conf ``` file.
104111
105- ## Installation
106-
107- ### Manual Installation
112+ ### Installation
108113
109114Firstly: will create external volume
115+
110116```
111- docker volume create --driver local --opt type=none --opt device=/home/ubuntu/full-stack-nginx-drupal-for-everyone-with-docker-compose /certbot --opt o=bind certbot-etc
117+ docker volume create --driver local --opt type=none --opt device=${DIRECTORY_PATH} /certbot --opt o=bind certbot-etc
112118```
113119
114120```
115- docker- compose up -d
121+ docker compose up -d
116122```
117123
118124then reloading for webserver ssl configuration
@@ -125,11 +131,11 @@ The containers are now built and running. You should be able to access the Drupa
125131
126132For convenience you may add a new entry into your hosts file.
127133
128- ### Installation Portainer
134+ ## Portainer
129135
130136```
131137docker volume create portainer_data
132- docker- compose -f portainer-docker-compose.yml -p portainer up -d
138+ docker compose -f portainer-docker-compose.yml -p portainer up -d
133139```
134140manage docker with [ Portainer] ( https://www.portainer.io/solutions/docker ) is the definitive container management tool for Docker, Docker Swarm with it's highly intuitive GUI and API.
135141
@@ -139,26 +145,34 @@ You can also visit `https://example.com:9001` to access portainer after starting
139145
140146#### You could manage docker containers without command line with portainer.
141147
148+ ### Show both running and stopped containers
149+
150+ The docker ps command only shows running containers by default. To see all containers, use the -a (or --all) flag:
151+
152+ ```
153+ docker ps -a
154+ ```
155+
142156### Starting containers
143157
144158You can start the containers with the ` up ` command in daemon mode (by adding ` -d ` as an argument) or by using the ` start ` command:
145159
146160```
147- docker- compose start
161+ docker compose start
148162```
149163
150164### Stopping containers
151165
152166```
153- docker- compose stop
167+ docker compose stop
154168```
155169
156170### Removing containers
157171
158- To stop and remove all the containers use the` down ` command:
172+ To stop and remove all the containers use the ` down ` command:
159173
160174```
161- docker- compose down
175+ docker compose down
162176```
163177
164178to remove portainer and the other containers
@@ -169,7 +183,7 @@ docker rm -f $(docker ps -a -q)
169183Use ` -v ` if you need to remove the database volume which is used to persist the database:
170184
171185```
172- docker- compose down -v
186+ docker compose down -v
173187```
174188
175189to remove external certbot-etc and portainer and the other volumes
@@ -185,36 +199,48 @@ Copy all files into a new directory:
185199You can now use the ` up ` command:
186200
187201```
188- docker- compose up -d
202+ docker compose up -d
189203```
190204
191- ### Website
205+ ### Docker run reference
192206
193- add or remove code in the ./php-fpm/php/conf.d/security.ini file for custom php.ini configurations
207+ [ https://docs.docker.com/engine/reference/run/ ] ( https://docs.docker.com/engine/reference/run/ )
194208
195- Copy and paste the following code in the ./php-fpm/php-fpm.d/z-www.conf file for php-fpm configurations at 1Gb Ram Host
209+ ### Website
210+
211+ You should see the "Hello, world!" page in your browser. If not, please check if your PHP installation satisfies Drupal's requirements.
196212
197213```
198- pm.max_children = 19
199- pm.start_servers = 4
200- pm.min_spare_servers = 2
201- pm.max_spare_servers = 4
202- pm.max_requests = 1000
214+ https://example.com
203215```
204216
205- Or you should make changes custom host configurations then must restart service
217+ add or remove code in the ./php-fpm/php/conf.d/security.ini file for custom php.ini configurations
218+
219+ [ https://www.php.net/manual/en/configuration.file.php ] ( https://www.php.net/manual/en/configuration.file.php )
220+
221+ You should make changes custom host configurations ``` ./php-fpm/php-fpm.d/z-www.conf ``` then must restart service, FPM uses php.ini syntax for its configuration file - php-fpm.conf, and pool configuration files.
222+
223+ [ https://www.php.net/manual/en/install.fpm.configuration.php ] ( https://www.php.net/manual/en/install.fpm.configuration.php )
206224
207225```
208226docker container restart drupal
209227```
210228
211- add and/or remove drupal site folders and files with any ftp client program in ``` ./drupal ``` folder.
229+ add and/or remove drupal site folders and files with any ftp client program in ``` ./drupal/webapp ``` folder.
212230<br />You can also visit ` https://example.com ` to access website after starting the containers.
213231
232+ #### Webserver
233+
234+ add or remove code in the ``` ./webserver/templates/nginx.conf.template ``` file for custom nginx configurations
235+
236+ [ https://docs.nginx.com/nginx/admin-guide/basic-functionality/managing-configuration-files/ ] ( https://docs.nginx.com/nginx/admin-guide/basic-functionality/managing-configuration-files/ )
237+
214238#### Database
215239
216240ADVANCED OPTIONS -> Host: database
217241
242+ [ https://mariadb.com/kb/en/configuring-mariadb-with-option-files/ ] ( https://mariadb.com/kb/en/configuring-mariadb-with-option-files/ )
243+
218244#### Redis
219245
220246if there isn't these lines, Edit Drupal settings file: ./drupal/sites/default/settings.php and add these lines at the bottom of the file:
@@ -228,8 +254,6 @@ $settings['redis.connection']['base'] = 8;
228254
229255#### Varnish
230256
231- [ This link is to complete configure Varnish] ( https://www.varnish-software.com/developers/tutorials/configuring-varnish-drupal/#4-configure-caching-and-purging-in-drupal )
232-
233257Varnish Server Hostname: varnish
234258
235259Varnish Server Port: 8080
@@ -242,6 +266,8 @@ All necessary changes to sites/default and sites/default/settings.php have been
242266chmod 655 ./drupal/sites/default/settings.php
243267```
244268
269+ [ This link is to complete configure Varnish] ( https://www.varnish-software.com/developers/tutorials/configuring-varnish-drupal/#4-configure-caching-and-purging-in-drupal )
270+
245271### phpMyAdmin
246272
247273You can add your own custom config.inc.php settings (such as Configuration Storage setup) by creating a file named config.user.inc.php with the various user defined settings in it, and then linking it into the container using:
@@ -256,14 +282,20 @@ The first authorize screen(htpasswd;username or password) and phpmyadmin login s
256282
257283### backup
258284
259- This will back up the all files and folders, once per day, and write it to ./backups with a filename like backup-2022-02-07T16-51-56.tar.gz
285+ This will back up the all files and folders, once per day, and write it to ./backups with a filename like backup-2022-02-07T16-51-56.tar.gz
260286
261- #### example for crontab file
287+ #### example for crontab file on the host machine
262288
263289##### # old docker backup folder remove
264- 50 23 * * * find /home/ubuntu/${DIRECTORY_PATH}/backups/backup* -type f -mtime +1 | xargs rm
265290
266- ##### # backup exclude drupal, backups folders in /home/ubuntu/${DIRECTORY_PATH}
267- 00 01 * * * tar -czvf /home/ubuntu/${DIRECTORY_PATH}/backups/'backup-example.com-'$(date +"\% Y-\% m-\% dT\% H-\% M-\% S")'.tar.gz' --exclude='drupal/core' --exclude='backups' /home/ubuntu/${DIRECTORY_PATH}
291+ ```
292+ 50 23 * * * find ${DIRECTORY_PATH}/backups/backup* -type f -mtime +1 | xargs rm
293+ ```
294+
295+ ##### # backup exclude drupal, backups folders in ${DIRECTORY_PATH}
296+
297+ ```
298+ 00 01 * * * tar -czvf ${DIRECTORY_PATH}/backups/'backup-example.com-'$(date +"\%Y-\%m-\%dT\%H-\%M-\%S")'.tar.gz' --exclude='backups' ${DIRECTORY_PATH}
299+ ```
268300
269301[ CronHowto] ( https://help.ubuntu.com/community/CronHowto )
0 commit comments