Skip to content

Commit 9c83c2c

Browse files
committed
Update README.md
1 parent 4e6c30e commit 9c83c2c

File tree

1 file changed

+87
-40
lines changed

1 file changed

+87
-40
lines changed

README.md

Lines changed: 87 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
1-
# [full stack proxy nginx drupal for everyone with docker compose](https://github.com/damalis/full-stack-proxy-nginx-drupal-for-everyone-with-docker-compose)
1+
# [full stack proxy nginx Drupal for everyone with docker compose](https://github.com/damalis/full-stack-proxy-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 Proxy 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>&nbsp;&nbsp;&nbsp; <a href="https://mariadb.org/" target="_blank" rel="noreferrer"> <img src="https://avatars.githubusercontent.com/u/4739304?s=200&v=4" alt="mariadb" height="40" width="40"/> </a>&nbsp;&nbsp;&nbsp; <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>&nbsp;&nbsp;&nbsp; <a href="https://www.php.net" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/github/explore/ccc16358ac4530c6a69b1b80c7223cd2744dea83/topics/php/php.png" alt="php" height="40" width="40"/> </a>&nbsp;&nbsp;&nbsp; <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>&nbsp;&nbsp;&nbsp;
7-
<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>&nbsp;&nbsp;&nbsp; <a href="https://www.apache.org/" target="_blank" rel="noreferrer"> <img src="https://avatars.githubusercontent.com/u/47359?s=200&v=4" alt="apache" height="40" width="40"/> </a>&nbsp;&nbsp;&nbsp; <a href="https://certbot.eff.org/" target="_blank" rel="noreferrer"> <img src="https://avatars.githubusercontent.com/u/17889013?s=200&v=4" alt="certbot" height="40" width="40"/> </a>&nbsp;&nbsp;&nbsp; <a href="https://letsencrypt.org/" target="_blank" rel="noreferrer"> <img src="https://avatars.githubusercontent.com/u/9289019?s=200&v=4" alt="letsencrypt" height="40" width="40"/> </a>&nbsp;&nbsp;&nbsp; <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>&nbsp;&nbsp;&nbsp; <a href="https://docs.docker.com/compose/" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/docker/compose/v2/logo.png" alt="docker compose" width="40" height="40" width="40"/> </a>&nbsp;&nbsp;&nbsp; <a href="https://www.gnu.org/software/bash/" target="_blank" rel="noreferrer"> <img src="https://raw.githubusercontent.com/github/explore/80688e429a7d4ef2fca1e82350fe8e3517d3494d/topics/bash/bash.png" alt="Bash" height="40" width="40" /> </a> </p>
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>&nbsp;&nbsp;&nbsp; <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>&nbsp;&nbsp;&nbsp; <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>&nbsp;&nbsp;&nbsp; <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>&nbsp;&nbsp;&nbsp; <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>&nbsp;&nbsp;&nbsp; <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>&nbsp;&nbsp;&nbsp; <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>&nbsp;&nbsp;&nbsp;
7+
<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>&nbsp;&nbsp;&nbsp; <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>&nbsp;&nbsp;&nbsp; <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

99
Plus, 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 (apache2/httpd)](https://hub.docker.com/_/httpd)
1515
- [proxy (nginx)](https://hub.docker.com/_/nginx)
1616
- [certbot (letsencrypt)](https://hub.docker.com/r/certbot/certbot)
@@ -35,9 +35,16 @@ Create rules to open ports to the internet, or to a specific IPv4 address or ran
3535

3636
- [Auto Configuration and Installation](#automatic)
3737
- [Requirements](#requirements)
38-
- [Configuration](#configuration)
39-
- [Installation](#installation)
38+
- [Manual Configuration and Installation](#manual)
39+
- [Portainer Installation](#portainer)
4040
- [Usage](#usage)
41+
- [Website](#website)
42+
- [Webserver](#webserver)
43+
- [Database](#database)
44+
- [Redis](#redis)
45+
- [Cache](#cache)
46+
- [phpMyAdmin](#phpmyadmin)
47+
- [backup](#backup)
4148

4249
## Automatic
4350

@@ -68,10 +75,11 @@ Clone this repository or copy the files from this repository into a new folder.
6875

6976
Make sure to [add your user to the `docker` group](https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user).
7077

71-
## Configuration
78+
## Manual
7279

73-
download with
80+
### Configuration
7481

82+
download with
7583
```
7684
git clone https://github.com/damalis/full-stack-proxy-nginx-drupal-for-everyone-with-docker-compose.git
7785
```
@@ -82,8 +90,6 @@ Open a terminal and `cd` to the folder in which `docker-compose.yml` is saved an
8290
cd full-stack-proxy-nginx-drupal-for-everyone-with-docker-compose
8391
```
8492

85-
### Manual Configuration
86-
8793
Copy the example environment into `.env`
8894

8995
```
@@ -104,37 +110,34 @@ cp ./phpmyadmin/apache2/sites-available/default-ssl.sample.conf ./phpmyadmin/apa
104110

105111
change example.com to your domain name in ```./phpmyadmin/apache2/sites-available/default-ssl.conf``` file.
106112

107-
## Installation
108-
109-
### Manual Installation
113+
### Installation
110114

111115
Firstly: will create external volume
112116

113117
```
114-
docker volume create --driver local --opt type=none --opt device=/home/ubuntu/full-stack-proxy-nginx-drupal-for-everyone-with-docker-compose/certbot --opt o=bind certbot-etc
118+
docker volume create --driver local --opt type=none --opt device=${DIRECTORY_PATH}/certbot --opt o=bind certbot-etc
115119
```
116120

117121
```
118-
docker-compose up -d
122+
docker compose up -d
119123
```
120124

121-
then reloading for proxy ssl configuration
125+
then reloading for webserver ssl configuration
122126

123127
```
124-
docker container restart proxy
128+
docker container restart webserver
125129
```
126130

127131
The containers are now built and running. You should be able to access the Drupal installation with the configured IP in the browser address. `https://example.com`.
128132

129133
For convenience you may add a new entry into your hosts file.
130134

131-
### Installation Portainer
135+
## Portainer
132136

133137
```
134138
docker volume create portainer_data
135-
docker-compose -f portainer-docker-compose.yml -p portainer up -d
139+
docker compose -f portainer-docker-compose.yml -p portainer up -d
136140
```
137-
138141
manage 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.
139142

140143
You can also visit `https://example.com:9001` to access portainer after starting the containers.
@@ -143,26 +146,34 @@ You can also visit `https://example.com:9001` to access portainer after starting
143146

144147
#### You could manage docker containers without command line with portainer.
145148

149+
### Show both running and stopped containers
150+
151+
The docker ps command only shows running containers by default. To see all containers, use the -a (or --all) flag:
152+
153+
```
154+
docker ps -a
155+
```
156+
146157
### Starting containers
147158

148159
You can start the containers with the `up` command in daemon mode (by adding `-d` as an argument) or by using the `start` command:
149160

150161
```
151-
docker-compose start
162+
docker compose start
152163
```
153164

154165
### Stopping containers
155166

156167
```
157-
docker-compose stop
168+
docker compose stop
158169
```
159170

160171
### Removing containers
161172

162173
To stop and remove all the containers use the `down` command:
163174

164175
```
165-
docker-compose down
176+
docker compose down
166177
```
167178

168179
to remove portainer and the other containers
@@ -173,7 +184,7 @@ docker rm -f $(docker ps -a -q)
173184
Use `-v` if you need to remove the database volume which is used to persist the database:
174185

175186
```
176-
docker-compose down -v
187+
docker compose down -v
177188
```
178189

179190
to remove external certbot-etc and portainer and the other volumes
@@ -189,36 +200,56 @@ Copy all files into a new directory:
189200
You can now use the `up` command:
190201

191202
```
192-
docker-compose up -d
203+
docker compose up -d
193204
```
194205

195-
### Website
206+
### Docker run reference
196207

197-
add or remove code in the ./php-fpm/php/conf.d/security.ini file for custom php.ini configurations
208+
[https://docs.docker.com/engine/reference/run/](https://docs.docker.com/engine/reference/run/)
198209

199-
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
210+
### Website
211+
212+
You should see the "Hello, world!" page in your browser. If not, please check if your PHP installation satisfies Drupal's requirements.
200213

201214
```
202-
pm.max_children = 19
203-
pm.start_servers = 4
204-
pm.min_spare_servers = 2
205-
pm.max_spare_servers = 4
206-
pm.max_requests = 1000
215+
https://example.com
207216
```
208217

209-
Or you should make changes custom host configurations then must restart service
218+
add or remove code in the ./php-fpm/php/conf.d/security.ini file for custom php.ini configurations
219+
220+
[https://www.php.net/manual/en/configuration.file.php](https://www.php.net/manual/en/configuration.file.php)
221+
222+
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.
223+
224+
[https://www.php.net/manual/en/install.fpm.configuration.php](https://www.php.net/manual/en/install.fpm.configuration.php)
210225

211226
```
212227
docker container restart drupal
213228
```
214229

215-
add and/or remove drupal site folders and files with any ftp client program in ```./drupal``` folder.
230+
add and/or remove drupal site folders and files with any ftp client program in ```./drupal/webapp``` folder.
216231
<br />You can also visit `https://example.com` to access website after starting the containers.
217232

233+
#### Proxy
234+
235+
Proxying is typically used to distribute the load among several servers, seamlessly show content from different websites, or pass requests for processing to application servers over protocols other than HTTP.
236+
237+
add or remove code in the ```./proxy/templates/proxy.conf.template``` file for custom proxy configurations
238+
239+
[https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/](https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/)
240+
241+
#### Webserver
242+
243+
add or remove code in the ```./webserver/extra/httpd-vhosts.conf``` file for custom apache2/httpd configurations
244+
245+
[https://httpd.apache.org/docs/2.4/](https://httpd.apache.org/docs/2.4/)
246+
218247
#### Database
219248

220249
ADVANCED OPTIONS -> Host: database
221250

251+
[https://mariadb.com/kb/en/configuring-mariadb-with-option-files/](https://mariadb.com/kb/en/configuring-mariadb-with-option-files/)
252+
222253
#### Redis
223254

224255
if there isn't these lines, Edit Drupal settings file: ./drupal/sites/default/settings.php and add these lines at the bottom of the file:
@@ -230,12 +261,22 @@ $settings['cache']['default'] = 'cache.backend.redis';
230261
$settings['redis.connection']['base'] = 8;
231262
```
232263

264+
#### Varnish
265+
266+
Varnish Server Hostname: varnish
267+
268+
Varnish Server Port: 8080
269+
270+
Scheme: http
271+
233272
All necessary changes to sites/default and sites/default/settings.php have been made, so you should remove write permissions to them now in order to avoid security risks.
234273

235274
```
236275
chmod 655 ./drupal/sites/default/settings.php
237276
```
238277

278+
[This link is to complete configure Varnish](https://www.varnish-software.com/developers/tutorials/configuring-varnish-drupal/#4-configure-caching-and-purging-in-drupal)
279+
239280
### phpMyAdmin
240281

241282
You 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:
@@ -252,12 +293,18 @@ The first authorize screen(htpasswd;username or password) and phpmyadmin login s
252293

253294
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
254295

255-
#### example for crontab file
296+
#### example for crontab file on the host machine
256297

257298
##### # old docker backup folder remove
258-
50 23 * * * find /home/ubuntu/${DIRECTORY_PATH}/backups/backup* -type f -mtime +1 | xargs rm
259299

260-
##### # backup exclude drupal, backups folders in /home/ubuntu/${DIRECTORY_PATH}
261-
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}
300+
```
301+
50 23 * * * find ${DIRECTORY_PATH}/backups/backup* -type f -mtime +1 | xargs rm
302+
```
303+
304+
##### # backup exclude drupal, backups folders in ${DIRECTORY_PATH}
305+
306+
```
307+
00 01 * * * tar -czvf ${DIRECTORY_PATH}/backups/'backup-example.com-'$(date +"\%Y-\%m-\%dT\%H-\%M-\%S")'.tar.gz' --exclude='backups' ${DIRECTORY_PATH}
308+
```
262309

263310
[CronHowto](https://help.ubuntu.com/community/CronHowto)

0 commit comments

Comments
 (0)