11# [ full stack proxy nginx Laravel for everyone with docker compose] ( https://github.com/damalis/full-stack-proxy-nginx-laravel-for-everyone-with-docker-compose )  
22
3- If You want to build a reverse proxy website with Laravel "webapp" at short time;
4- 
5- #### Full stack Proxy Nginx Laravel "webapp":  
6- <p align="left"> <a href="https://laravel.com/" target="_blank" rel="noreferrer"> <img src="https://avatars.githubusercontent.com/u/958072?s=200&v=4" alt="Laravel" 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.apache.org" target="_blank" rel="noreferrer"> <img src="https://avatars.githubusercontent.com/u/47359?s=200&v=4" alt="apache2" 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>   
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 >  ;  ;  ;  <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 >  ;  ;  ;  <a  href =" https://www.offen.dev/ "  target =" _blank "  rel =" noreferrer " > <img  src =" https://avatars.githubusercontent.com/u/47735043?s=200&v=4 "  alt =" backup "  height =" 35 "  width =" 35 " /> </a > </p >
3+ If You want to build a reverse proxy website with Laravel at short time;
4+ 
5+ #### Full stack Proxy Nginx Laravel:  
6+ <p  align =" left " > <a  href =" https://laravel.com/ "  target =" _blank "  rel =" noreferrer " > <img  src =" https://avatars.githubusercontent.com/u/958072?s=200&v=4 "  alt =" Laravel "  height =" 40 "  width =" 40 " /> </a >  ;  ;  ;  
7+ <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 >  ;  ;  ;  
8+ <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 >  ;  ;  ;  
9+ <a  href =" https://dev.mysql.com/ "  target =" _blank "  rel =" noreferrer " > <img  src =" https://avatars.githubusercontent.com/u/2452804?s=200&v=4 "  alt =" mysql "  height =" 50 "  width =" 50 " /> </a >  ;  ;  ;  
10+ <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 >  ;  ;  ;  
11+ <a  href =" https://www.apache.org "  target =" _blank "  rel =" noreferrer " > <img  src =" https://avatars.githubusercontent.com/u/47359?s=200&v=4 "  alt =" apache2 "  height =" 40 "  width =" 40 " /> </a >  ;  ;  ;  
12+ <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 >  ;  ;  ;  
13+ <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 >  ;  ;  ;  
14+ <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 >  ;  ;  ;  
15+ <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 >  ;  ;  ;  
16+ <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 >  ;  ;  ;  
17+ <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 >  ;  ;  ;  
18+ <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 >  ;  ;  ;  
19+ <a  href =" https://www.offen.dev/ "  target =" _blank "  rel =" noreferrer " > <img  src =" https://avatars.githubusercontent.com/u/47735043?s=200&v=4 "  alt =" backup "  height =" 35 "  width =" 35 " /> </a > </p >
820
921Plus, manage docker containers with Portainer.
1022
23+ #### Supported CPU architectures:  
24+ <p  align =" left " > arm64/aarch64, x86-64 </p >
25+ 
26+ #### Supported Linux Package Manage Systems:  
27+ <p  align =" left " > apk, dnf, yum, apt/apt-get, zypper </p >
28+  
29+ #### Supported Linux Operation Systems:  
30+ <p  align =" left " > <a  href =" https://alpinelinux.org/ "  target =" _blank "  rel =" noreferrer " > <img  src =" https://avatars.githubusercontent.com/u/7600810?s=200&v=4 "  alt =" alpine linux "  height =" 40 "  width =" 40 " /> </a >  ;  ;  ;  
31+ <a  href =" https://fedoraproject.org/ "  target =" _blank "  rel =" noreferrer " > <img  src =" https://raw.githubusercontent.com/github/explore/e6b1e7f0fb8d0bf920bd719c7289243138bdc1b4/topics/fedora/fedora.png "  alt =" fedora "  height =" 40 "  width =" 40 " /> </a >  ;  ;  ;  
32+ <a  href =" https://www.centos.org/ "  target =" _blank "  rel =" noreferrer " > <img  src =" https://avatars.githubusercontent.com/u/79192?s=200&v=4 "  alt =" centos "  height =" 40 "  width =" 40 " /> </a >  ;  ;  ;  
33+ <a  href =" https://www.debian.org/ "  target =" _blank "  rel =" noreferrer " > <img  src =" https://avatars.githubusercontent.com/u/1854028?s=200&v=4 "  alt =" debian "  height =" 40 "  width =" 40 " /> </a >  ;  ;  ;  
34+ <a  href =" https://ubuntu.com/ "  target =" _blank "  rel =" noreferrer " > <img  src =" https://avatars.githubusercontent.com/u/4604537?s=200&v=4 "  alt =" ubuntu "  height =" 40 "  width =" 40 " /> </a >  ;  ;  ;  
35+ <a  href =" https://www.raspberrypi.com/ "  target =" _blank "  rel =" noreferrer " > <img  src =" https://avatars.githubusercontent.com/u/1294177?s=200&v=4 "  alt =" ubuntu "  height =" 40 "  width =" 40 " /> </a >  ;  ;  ;  
36+ <a  href =" https://www.redhat.com/en/technologies/linux-platforms/enterprise-linux "  target =" _blank "  rel =" noreferrer " > <img  src =" https://avatars.githubusercontent.com/u/33972111?s=200&v=4 "  alt =" redhat on s390x (IBM Z) "  height =" 40 "  width =" 40 " /> </a >  ;  ;  ;  
37+ <a  href =" https://www.suse.com/products/server/ "  target =" _blank "  rel =" noreferrer " > <img  src =" https://avatars.githubusercontent.com/u/623819?s=200&v=4 "  alt =" opensuse on s390x (IBM Z) "  height =" 40 "  width =" 40 " /> </a > </p >
38+ 
39+ ##### Note: Fedora 37, 39 and alpine linux x86-64 compatible, could not try sles IBM Z s390x, rhel IBM Z s390x and raspberrypi.  
40+ 
1141#### With this project you can quickly run the following:  
1242
1343-  [ Laravel] ( https://github.com/laravel )  - [ php-fpm] ( https://hub.docker.com/_/php?tab=tags&page=1&name=fpm ) 
1444-  [ webserver (apache2/httpd)] ( https://hub.docker.com/_/httpd ) 
1545-  [ proxy (nginx)] ( https://hub.docker.com/_/nginx ) 
1646-  [ certbot (letsencrypt)] ( https://hub.docker.com/r/certbot/certbot ) 
1747-  [ phpMyAdmin] ( https://hub.docker.com/r/phpmyadmin/phpmyadmin/ ) 
18- -  [ database ] ( https://hub.docker.com/_/mariadb ) 
48+ -  [ databaseMariadb ] ( https://hub.docker.com/_/mariadb )   [ databaseMysql ] ( https://hub.docker.com/_/mysql ) 
1949-  [ redis] ( https://hub.docker.com/_/redis ) 
2050-  [ backup] ( https://hub.docker.com/r/offen/docker-volume-backup ) 
2151
@@ -45,7 +75,7 @@ Create rules to open ports to the internet, or to a specific IPv4 address or ran
4575	- [Redis](#redis) 
4676	- [Cache](#cache) 
4777	- [phpMyAdmin](#phpmyadmin) 
48- 	- [backup](#backup)					    
78+ 	- [backup](#backup) 
4979
5080## Automatic  
5181
@@ -72,15 +102,16 @@ Make sure you have the latest versions of **Docker** and **Docker Compose** inst
72102-  [ How install docker] ( https://docs.docker.com/engine/install/ ) 
73103-  [ How install docker compose] ( https://docs.docker.com/compose/install/ ) 
74104
75- Clone this repository or copy the files from this repository into a new folder. In the  ** docker-compose.yml **  file you may change the database from MariaDB to MySQL. 
105+ Clone this repository or copy the files from this repository into a new folder.
76106
77107Make sure to [ add your user to the ` docker `  group] ( https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user ) .
78108
79109## Manual  
80110
81111### Configuration  
82- 	 			  
112+ 
83113download with
114+ 
84115``` 
85116git clone https://github.com/damalis/full-stack-proxy-nginx-laravel-for-everyone-with-docker-compose.git 
86117``` 
@@ -97,26 +128,36 @@ Copy the example environment into `.env`
97128cp env.example .env 
98129``` 
99130
100- Edit the ` .env `  file to change values of ``` LOCAL_TIMEZONE ``` , ``` DOMAIN_NAME ``` , ``` DIRECTORY_PATH ``` , ``` LETSENCRYPT_EMAIL ``` , ``` DB_USER ``` , ``` DB_PASSWORD ``` , ``` DB_NAME ``` , ``` MYSQL_ROOT_PASSWORD ``` , ``` PMA_CONTROLUSER ``` , ``` PMA_CONTROLPASS ``` , ``` PMA_HTPASSWD_USERNAME ```  and ``` PMA_HTPASSWD_PASSWORD ``` .
131+ Edit the ` .env `  file to change values of ``` LOCAL_TIMEZONE ``` , ``` DOMAIN_NAME ``` , ``` DIRECTORY_PATH ``` , ``` LETSENCRYPT_EMAIL ``` , ``` DB_USER ``` , ``` DB_PASSWORD ``` , ``` DB_NAME ``` , ``` MYSQL_ROOT_PASSWORD ``` , ``` DATABASE_IMAGE_NAME ``` ,  ``` DATABASE_CONT_NAME ``` ,  ``` DATABASE_PACKAGE_MANAGER ``` ,  ``` DATABASE_AUTHENTICATION_PLUGIN ``` ,  ``` DATABASE_ADMIN_COMMANDLINE ``` ,  ``` PMA_CONTROLUSER ``` , ``` PMA_CONTROLPASS ``` , ``` PMA_HTPASSWD_USERNAME ```  and ``` PMA_HTPASSWD_PASSWORD ``` .
101132
102133LOCAL_TIMEZONE=[ to see local timezones] ( https://docs.diladele.com/docker/timezones.html ) 
103134
104- DIRECTORY_PATH=``` pwd ```  at command line
135+ DIRECTORY_PATH=``` pwd ```  at command line\ 
136+ DATABASE_IMAGE_NAME=``` mariadb ```  or ``` mysql ``` \ 
137+ DATABASE_CONT_NAME=``` mariadb ``` , ``` mysql ```  or ``` custom name ``` \ 
138+ DATABASE_PACKAGE_MANAGER=``` apt-get update && apt-get install -y gettext-base ```  for mariadb, ``` microdnf install -y gettext ```  for mysql\ 
139+ DATABASE_AUTHENTICATION_PLUGIN=``` mysql_native_password ```  for mariadb, ``` caching_sha2_password ```  for mysql\ 
140+ DATABASE_ADMIN_COMMANDLINE=``` mariadb-admin ```  for mariadb, ``` mysqladmin ```  for mysql\ 
141+ VARNISH_VERSION=``` latest ```  for centos version 9+ and fedora, ``` stable ```  for the others
105142
106143and
107144
108145``` 
109146cp ./phpmyadmin/apache2/sites-available/default-ssl.sample.conf ./phpmyadmin/apache2/sites-available/default-ssl.conf 
110147``` 
111- 
112148change example.com to your domain name in ``` ./phpmyadmin/apache2/sites-available/default-ssl.conf ```  file.
113149
150+ ``` 
151+ cp ./database/phpmyadmin/sql/create_tables.sql.template.example ./database/phpmyadmin/sql/create_tables.sql.template 
152+ ``` 
153+ change pma_controluser, db_authentication_plugin and db_authentication_password in ``` ./database/phpmyadmin/sql/create_tables.sql.template ```  file.
154+ 
114155### Installation  
115156
116157Firstly: will create external volume
117158
118159``` 
119- docker volume create --driver local --opt type=none --opt device=${DIRECTORY_PATH }/certbot --opt o=bind certbot-etc 
160+ docker volume create --driver local --opt type=none --opt device=${PWD }/certbot --opt o=bind certbot-etc 
120161``` 
121162
122163``` 
@@ -177,7 +218,8 @@ To stop and remove all the containers use the `down` command:
177218docker compose down 
178219``` 
179220
180- to remove portainer and the other containers
221+ to remove portainer and the other containers:
222+ 
181223``` 
182224docker rm -f $(docker ps -a -q) 
183225``` 
@@ -188,13 +230,26 @@ Use `-v` if you need to remove the database volume which is used to persist the
188230docker compose down -v 
189231``` 
190232
191- to remove external certbot-etc and portainer and the other volumes
233+ to remove external certbot-etc and portainer and the other volumes: 
192234
193235``` 
194236docker volume rm $(docker volume ls -q) 
195237``` 
196238
197- to remove portainer and the other images
239+ Delete all images, containers, volumes, and networks that are not associated with a container (dangling):
240+ 
241+ ``` 
242+ docker system prune 
243+ ``` 
244+ 
245+ To additionally remove any stopped containers and all unused images (not just dangling ones), add the -a flag to the command:
246+ 
247+ ``` 
248+ docker system prune -a 
249+ ``` 
250+ 
251+ to remove portainer and the other images:
252+ 
198253``` 
199254docker rmi $(docker image ls -q) 
200255``` 
@@ -233,11 +288,11 @@ You should make changes custom host configurations ```./php-fpm/php-fpm.d/z-www.
233288docker container restart laravel 
234289``` 
235290
236- Many important configuration values are defined using the ``` ./laravel/webapp/ .env ```  file that exists at the root of your application.
291+ Many important configuration values are defined using the ``` ./laravel/.env ```  file that exists at the root of your application.
237292
238293[ https://laravel.com/docs/9.x#environment-based-configuration ] ( https://laravel.com/docs/9.x#environment-based-configuration ) 
239294
240- add and/or remove laravel site folders and files with any ftp client program in ``` ./laravel/webapp  ```  folder.
295+ add and/or remove laravel site folders and files with any ftp client program in ``` ./laravel ```  folder.
241296<br  />You can also visit ` https://example.com `  to access website after starting the containers.
242297
243298#### Proxy  
@@ -262,14 +317,16 @@ The configuration for Laravel's database services is located in your application
262317
263318[ https://mariadb.com/kb/en/configuring-mariadb-with-option-files/ ] ( https://mariadb.com/kb/en/configuring-mariadb-with-option-files/ ) 
264319
320+ [ https://dev.mysql.com/doc/refman/8.3/en/ ] ( https://dev.mysql.com/doc/refman/8.3/en/ ) 
321+ 
265322#### Redis  
266323
267324You may configure your application's Redis settings via the config/database.php configuration file.
268325
269326[ https://laravel.com/docs/9.x/redis ] ( https://laravel.com/docs/9.x/redis ) 
270327
271328#### Cache  
272-   
329+ 
273330Your application's cache configuration file is located at config/cache.php.
274331
275332[ https://laravel.com/docs/9.x/cache#main-content ] ( https://laravel.com/docs/9.x/cache#main-content ) 
0 commit comments