33If You want to build a website with Rails at short time;
44
55#### Full stack Nginx Rails:
6- <p align="left"> <a href="https://rubyonrails.org/" target="_blank" rel="noreferrer"> <img src="https://avatars.githubusercontent.com/u/4223?s=200&v=4" alt="Rails" 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://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 >
6+ <p align =" left " > <a href =" https://rubyonrails.org/ " target =" _blank " rel =" noreferrer " > <img src =" https://avatars.githubusercontent.com/u/4223?s=200&v=4 " alt =" Rails " 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://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 >  ;  ;  ;
12+ <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 >  ;  ;  ;
13+ <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 >  ;  ;  ;
14+ <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 >  ;  ;  ;
15+ <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 >  ;  ;  ;
16+ <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 >  ;  ;  ;
17+ <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 >
818
919Plus, manage docker containers with Portainer.
1020
21+ #### Supported CPU architectures:
22+ <p align =" left " > arm64/aarch64, x86-64 </p >
23+
24+ #### Supported Linux Package Manage Systems:
25+ <p align =" left " > apk, dnf, yum, apt/apt-get, zypper </p >
26+
27+ #### Supported Linux Operation Systems:
28+ <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 >  ;  ;  ;
29+ <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 >  ;  ;  ;
30+ <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 >  ;  ;  ;
31+ <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 >  ;  ;  ;
32+ <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 >  ;  ;  ;
33+ <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 >  ;  ;  ;
34+ <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 >  ;  ;  ;
35+ <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 >
36+
37+ ##### Note: Fedora 37, 39 and alpine linux x86-64 compatible, could not try sles IBM Z s390x, rhel IBM Z s390x and raspberrypi.
38+
1139#### With this project you can quickly run the following:
1240
1341- [ Rails] ( https://github.com/rails )
1442- [ webserver (nginx)] ( https://hub.docker.com/_/nginx )
1543- [ certbot (letsencrypt)] ( https://hub.docker.com/r/certbot/certbot )
1644- [ phpMyAdmin] ( https://hub.docker.com/r/phpmyadmin/phpmyadmin/ )
17- - [ database ] ( https://hub.docker.com/_/mariadb )
45+ - [ databaseMariadb ] ( https://hub.docker.com/_/mariadb ) [ databaseMysql ] ( https://hub.docker.com/_/mysql )
1846- [ redis] ( https://hub.docker.com/_/redis )
1947- [ backup] ( https://hub.docker.com/r/offen/docker-volume-backup )
2048
@@ -42,7 +70,7 @@ Create rules to open ports to the internet, or to a specific IPv4 address or ran
4270 - [Database](#database)
4371 - [Redis](#redis)
4472 - [phpMyAdmin](#phpmyadmin)
45- - [backup](#backup)
73+ - [backup](#backup)
4674
4775## Automatic
4876
@@ -69,7 +97,7 @@ Make sure you have the latest versions of **Docker** and **Docker Compose** inst
6997- [ How install docker] ( https://docs.docker.com/engine/install/ )
7098- [ How install docker compose] ( https://docs.docker.com/compose/install/ )
7199
72- 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.
100+ Clone this repository or copy the files from this repository into a new folder.
73101
74102Make sure to [ add your user to the ` docker ` group] ( https://docs.docker.com/install/linux/linux-postinstall/#manage-docker-as-a-non-root-user ) .
75103
@@ -78,6 +106,7 @@ Make sure to [add your user to the `docker` group](https://docs.docker.com/insta
78106### Configuration
79107
80108download with
109+
81110```
82111git clone https://github.com/damalis/full-stack-nginx-rails-for-everyone-with-docker-compose.git
83112```
@@ -94,26 +123,35 @@ Copy the example environment into `.env`
94123cp env.example .env
95124```
96125
97- 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 ``` .
126+ 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 ``` .
98127
99128LOCAL_TIMEZONE=[ to see local timezones] ( https://docs.diladele.com/docker/timezones.html )
100129
101- DIRECTORY_PATH=``` pwd ``` at command line
130+ DIRECTORY_PATH=``` pwd ``` at command line\
131+ DATABASE_IMAGE_NAME=``` mariadb ``` or ``` mysql ``` \
132+ DATABASE_CONT_NAME=``` mariadb ``` , ``` mysql ``` or ``` custom name ``` \
133+ DATABASE_PACKAGE_MANAGER=``` apt-get update && apt-get install -y gettext-base ``` for mariadb, ``` microdnf install -y gettext ``` for mysql\
134+ DATABASE_AUTHENTICATION_PLUGIN=``` mysql_native_password ``` for mariadb, ``` caching_sha2_password ``` for mysql\
135+ DATABASE_ADMIN_COMMANDLINE=``` mariadb-admin ``` for mariadb, ``` mysqladmin ``` for mysql
102136
103137and
104138
105139```
106140cp ./phpmyadmin/apache2/sites-available/default-ssl.sample.conf ./phpmyadmin/apache2/sites-available/default-ssl.conf
107141```
108-
109142change example.com to your domain name in ``` ./phpmyadmin/apache2/sites-available/default-ssl.conf ``` file.
110143
144+ ```
145+ cp ./database/phpmyadmin/sql/create_tables.sql.template.example ./database/phpmyadmin/sql/create_tables.sql.template
146+ ```
147+ change pma_controluser, db_authentication_plugin and db_authentication_password in ``` ./database/phpmyadmin/sql/create_tables.sql.template ``` file.
148+
111149### Installation
112150
113151Firstly: will create external volume
114152
115153```
116- docker volume create --driver local --opt type=none --opt device=${DIRECTORY_PATH }/certbot --opt o=bind certbot-etc
154+ docker volume create --driver local --opt type=none --opt device=${PWD }/certbot --opt o=bind certbot-etc
117155```
118156
119157```
@@ -135,6 +173,7 @@ For convenience you may add a new entry into your hosts file.
135173```
136174docker compose -f portainer-docker-compose.yml -p portainer up -d
137175```
176+
138177manage docker with [ Portainer] ( https://www.portainer.io/ ) is the definitive container management tool for Docker, Docker Swarm with it's highly intuitive GUI and API.
139178
140179You can also visit ` https://example.com:9001 ` to access portainer after starting the containers.
@@ -173,7 +212,8 @@ To stop and remove all the containers use the `down` command:
173212docker compose down
174213```
175214
176- to remove portainer and the other containers
215+ to remove portainer and the other containers:
216+
177217```
178218docker rm -f $(docker ps -a -q)
179219```
@@ -184,13 +224,26 @@ Use `-v` if you need to remove the database volume which is used to persist the
184224docker compose down -v
185225```
186226
187- to remove external certbot-etc and portainer and the other volumes
227+ to remove external certbot-etc and portainer and the other volumes:
188228
189229```
190230docker volume rm $(docker volume ls -q)
191231```
192232
193- to remove portainer and the other images
233+ Delete all images, containers, volumes, and networks that are not associated with a container (dangling):
234+
235+ ```
236+ docker system prune
237+ ```
238+
239+ To additionally remove any stopped containers and all unused images (not just dangling ones), add the -a flag to the command:
240+
241+ ```
242+ docker system prune -a
243+ ```
244+
245+ to remove portainer and the other images:
246+
194247```
195248docker rmi $(docker image ls -q)
196249```
@@ -256,6 +309,8 @@ test:
256309
257310[ https://mariadb.com/kb/en/configuring-mariadb-with-option-files/ ] ( https://mariadb.com/kb/en/configuring-mariadb-with-option-files/ )
258311
312+ [ https://dev.mysql.com/doc/refman/8.3/en/ ] ( https://dev.mysql.com/doc/refman/8.3/en/ )
313+
259314#### Redis
260315
261316add the configuration in the relevant ``` ./rails/config/environments/*.rb ``` file:
0 commit comments