|
| 1 | +# full stack apache2 joomla for everyone with docker compose |
| 2 | + |
| 3 | +If You want to have a joomla website at short time; |
| 4 | + |
| 5 | +Full stack Joomla: |
| 6 | +<p align="left"> <a href="https://www.joomla.org/" target="_blank" rel="noreferrer"> <img style="margin: 10px" src="https://avatars.githubusercontent.com/u/69416061?s=200&v=4" alt="joomla" 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.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 style="margin: 10px" 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 style="margin: 10px" src="https://avatars.githubusercontent.com/u/1351977?s=200&v=4" alt="phpmyadmin" height="40" width="40"/> </a> <a href="https://www.apache.org/" target="_blank" rel="noreferrer"> <img style="margin: 10px" src="https://avatars.githubusercontent.com/u/47359?s=200&v=4" alt="apache" height="40" width="40"/> </a> <a href="https://letsencrypt.org/" target="_blank" rel="noreferrer"> <img style="margin: 10px" 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 style="margin: 10px" src="https://avatars.githubusercontent.com/u/22225832?s=200&v=4" alt="portainer" height="40" width="40"/> </a> </p> |
| 8 | + |
| 9 | +Plus, manage docker containers with Portainer. |
| 10 | + |
| 11 | +With this project you can quickly run the following: |
| 12 | + |
| 13 | +- [joomla (php-fpm)](https://hub.docker.com/_/joomla) |
| 14 | +- [webserver (apache2/httpd)](https://hub.docker.com/_/httpd) |
| 15 | +- [certbot (letsencrypt)](https://hub.docker.com/r/certbot/certbot) |
| 16 | +- [phpMyAdmin](https://hub.docker.com/r/phpmyadmin/phpmyadmin/) |
| 17 | +- [database](https://hub.docker.com/_/mariadb) |
| 18 | +- [redis](https://hub.docker.com/_/redis) |
| 19 | +- [backup](https://hub.docker.com/r/futurice/docker-volume-backup) |
| 20 | + |
| 21 | +For certbot (letsencrypt) certificate: |
| 22 | + |
| 23 | +- [Set DNS configuration of your domain name](https://support.google.com/a/answer/48090?hl=en) |
| 24 | + |
| 25 | +#### IPv4/IPv6 Firewall |
| 26 | +Create rules to open ports to the internet, or to a specific IPv4 address or range. |
| 27 | + |
| 28 | +- http: 80 |
| 29 | +- https: 443 |
| 30 | +- portainer: 9001 |
| 31 | +- phpmyadmin: 9090 |
| 32 | + |
| 33 | +Contents: |
| 34 | + |
| 35 | +- [Auto Configuration and Installation](#automatic) |
| 36 | +- [Requirements](#requirements) |
| 37 | +- [Configuration](#configuration) |
| 38 | +- [Installation](#installation) |
| 39 | +- [Usage](#usage) |
| 40 | + |
| 41 | +## Automatic |
| 42 | + |
| 43 | +### Exec install shell script for auto installation and configuration |
| 44 | + |
| 45 | +download with |
| 46 | +``` |
| 47 | +git clone https://github.com/damalis/full-stack-apache2-joomla-for-everyone-with-docker-compose.git |
| 48 | +``` |
| 49 | +Open a terminal and `cd` to the folder in which `docker-compose.yml` is saved and run: |
| 50 | + |
| 51 | +``` |
| 52 | +cd full-stack-apache2-joomla-for-everyone-with-docker-compose |
| 53 | +chmod +x install.sh |
| 54 | +./install.sh |
| 55 | +``` |
| 56 | + |
| 57 | +## Requirements |
| 58 | + |
| 59 | +Make sure you have the latest versions of **Docker** and **Docker Compose** installed on your machine. |
| 60 | + |
| 61 | +- [How install docker](https://docs.docker.com/engine/install/) |
| 62 | +- [How install docker compose](https://docs.docker.com/compose/install/) |
| 63 | + |
| 64 | +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. |
| 65 | + |
| 66 | +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). |
| 67 | + |
| 68 | +## Configuration |
| 69 | + |
| 70 | +download with |
| 71 | +``` |
| 72 | +git clone https://github.com/damalis/full-stack-apache2-joomla-for-everyone-with-docker-compose.git |
| 73 | +``` |
| 74 | + |
| 75 | +Open a terminal and `cd` to the folder in which `docker-compose.yml` is saved and run: |
| 76 | + |
| 77 | +``` |
| 78 | +cd full-stack-apache2-joomla-for-everyone-with-docker-compose |
| 79 | +``` |
| 80 | + |
| 81 | +### Manual Configuration |
| 82 | + |
| 83 | +Copy the example environment into `.env` |
| 84 | + |
| 85 | +``` |
| 86 | +cp env.example .env |
| 87 | +``` |
| 88 | + |
| 89 | +Edit the `.env` file to change values of ```LOCAL_TIMEZONE```, ```DOMAIN_NAME```, ```DIRECTORY_PATH```, ```LETSENCRYPT_EMAIL```, ```JOOMLA_DB_USER```, ```JOOMLA_DB_PASSWORD```, ```JOOMLA_DB_NAME```, ```MYSQL_ROOT_PASSWORD```, ```PMA_CONTROLUSER```, ```PMA_CONTROLPASS```, ```PMA_HTPASSWD_USERNAME``` and ```PMA_HTPASSWD_PASSWORD```. |
| 90 | + |
| 91 | +LOCAL_TIMEZONE=[to see local timezones](https://docs.diladele.com/docker/timezones.html) |
| 92 | + |
| 93 | +DIRECTORY_PATH=```pwd``` at command line |
| 94 | + |
| 95 | +and |
| 96 | + |
| 97 | +``` |
| 98 | +cp ./phpmyadmin/apache2/sites-available/default-ssl.sample.conf ./phpmyadmin/apache2/sites-available/default-ssl.conf |
| 99 | +``` |
| 100 | + |
| 101 | +change example.com to your domain name in ```./phpmyadmin/apache2/sites-available/default-ssl.conf``` file. |
| 102 | + |
| 103 | +## Installation |
| 104 | + |
| 105 | +### Manual Installation |
| 106 | + |
| 107 | +Firstly: will create external volume |
| 108 | +``` |
| 109 | +docker volume create --driver local --opt type=none --opt device=/home/ubuntu/full-stack-apache2-joomla-for-everyone-with-docker-compose/certbot --opt o=bind certbot-etc |
| 110 | +``` |
| 111 | + |
| 112 | +``` |
| 113 | +docker-compose up -d |
| 114 | +``` |
| 115 | + |
| 116 | +then reloading for webserver ssl configuration |
| 117 | + |
| 118 | +``` |
| 119 | +docker exec webserver nginx -s reload |
| 120 | +``` |
| 121 | + |
| 122 | +The containers are now built and running. You should be able to access the Joomla installation with the configured IP in the browser address. `https://example.com`. |
| 123 | + |
| 124 | +For convenience you may add a new entry into your hosts file. |
| 125 | + |
| 126 | +### Installation Portainer |
| 127 | + |
| 128 | +``` |
| 129 | +docker-compose -f portainer-docker-compose.yml -p portainer up -d |
| 130 | +``` |
| 131 | +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. |
| 132 | + |
| 133 | +You can also visit `https://example.com:9001` to access portainer after starting the containers. |
| 134 | + |
| 135 | +## Usage |
| 136 | + |
| 137 | +#### You could manage docker containers without command line with portainer. |
| 138 | + |
| 139 | +### Starting containers |
| 140 | + |
| 141 | +You can start the containers with the `up` command in daemon mode (by adding `-d` as an argument) or by using the `start` command: |
| 142 | + |
| 143 | +``` |
| 144 | +docker-compose start |
| 145 | +``` |
| 146 | + |
| 147 | +### Stopping containers |
| 148 | + |
| 149 | +``` |
| 150 | +docker-compose stop |
| 151 | +``` |
| 152 | + |
| 153 | +### Removing containers |
| 154 | + |
| 155 | +To stop and remove all the containers use the`down` command: |
| 156 | + |
| 157 | +``` |
| 158 | +docker-compose down |
| 159 | +``` |
| 160 | + |
| 161 | +to remove portainer and the other containers |
| 162 | +``` |
| 163 | +docker rm -f $(docker ps -a -q) |
| 164 | +``` |
| 165 | + |
| 166 | +Use `-v` if you need to remove the database volume which is used to persist the database: |
| 167 | + |
| 168 | +``` |
| 169 | +docker-compose down -v |
| 170 | +``` |
| 171 | + |
| 172 | +to remove external certbot-etc and portainer and the other volumes |
| 173 | + |
| 174 | +``` |
| 175 | +docker volume rm $(docker volume ls -q) |
| 176 | +``` |
| 177 | + |
| 178 | +### Project from existing source |
| 179 | + |
| 180 | +Copy all files into a new directory: |
| 181 | + |
| 182 | +You can now use the `up` command: |
| 183 | + |
| 184 | +``` |
| 185 | +docker-compose up -d |
| 186 | +``` |
| 187 | + |
| 188 | +### Website |
| 189 | + |
| 190 | +add or remove code in the ./php-fpm/php/conf.d/security.ini file for custom php.ini configurations |
| 191 | + |
| 192 | +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 |
| 193 | + |
| 194 | +``` |
| 195 | +pm.max_children = 19 |
| 196 | +pm.start_servers = 4 |
| 197 | +pm.min_spare_servers = 2 |
| 198 | +pm.max_spare_servers = 4 |
| 199 | +pm.max_requests = 1000 |
| 200 | +``` |
| 201 | + |
| 202 | +Or you should make changes custom host configurations then must restart service |
| 203 | + |
| 204 | +``` |
| 205 | +docker container restart <joomla_container_id> |
| 206 | +``` |
| 207 | + |
| 208 | +add and/or remove joomla site folders and files with any ftp client program in ```./joomla``` folder. |
| 209 | +<br />You can also visit `https://example.com` to access website after starting the containers. |
| 210 | + |
| 211 | +#### Redis |
| 212 | + |
| 213 | +set and enable cache option at global configuration [Redis Cache](https://example.com/administrator/). |
| 214 | + |
| 215 | +Cache Handler = redis |
| 216 | + |
| 217 | +Redis Server Host = redis |
| 218 | + |
| 219 | +Redis Server Port = 6379 |
| 220 | + |
| 221 | +### phpMyAdmin |
| 222 | + |
| 223 | +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: |
| 224 | + |
| 225 | +``` |
| 226 | +./phpmyadmin/config.user.inc.php |
| 227 | +``` |
| 228 | + |
| 229 | +You can also visit `https://example.com:9090` to access phpMyAdmin after starting the containers. |
| 230 | + |
| 231 | +The first authorize screen(htpasswd;username or password) and phpmyadmin login screen the username and the password is the same as supplied in the `.env` file. |
| 232 | + |
| 233 | +### backup |
| 234 | + |
| 235 | +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 |
0 commit comments