Skip to content

Commit cf19504

Browse files
committed
added localhost and remotehost options and support arch linux(pacman package manager)
1 parent 545ba5e commit cf19504

File tree

3 files changed

+124
-37
lines changed

3 files changed

+124
-37
lines changed

README.md

Lines changed: 20 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Plus, manage docker containers with Portainer.
2424
<p align="left"> arm64/aarch64, x86-64 </p>
2525

2626
#### Supported Linux Package Manage Systems:
27-
<p align="left"> apk, dnf, yum, apt/apt-get, zypper </p>
27+
<p align="left"> apk, dnf, yum, apt/apt-get, zypper, pacman </p>
2828

2929
#### Supported Linux Operation Systems:
3030
<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>&nbsp;&nbsp;&nbsp;
@@ -34,7 +34,8 @@ Plus, manage docker containers with Portainer.
3434
<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>&nbsp;&nbsp;&nbsp;
3535
<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>&nbsp;&nbsp;&nbsp;
3636
<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>&nbsp;&nbsp;&nbsp;
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>
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>&nbsp;&nbsp;&nbsp;
38+
<a href="https://archlinux.org/" target="_blank" rel="noreferrer"> <img src="https://gitlab.archlinux.org/uploads/-/system/group/avatar/23/iconfinder_archlinux_386451.png?width=48" alt="arch linux" height="40" width="40"/> </a> </p>
3839

3940
##### Note: Fedora 37, 39 and alpine linux x86-64 compatible, could not try sles IBM Z s390x, rhel IBM Z s390x and raspberrypi.
4041

@@ -128,17 +129,17 @@ Copy the example environment into `.env`
128129
cp env.example .env
129130
```
130131

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```.
132+
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_ADMIN_COMMANDLINE```, ```PMA_CONTROLUSER```, ```PMA_CONTROLPASS```, ```PMA_HTPASSWD_USERNAME``` and ```PMA_HTPASSWD_PASSWORD```.
132133

133134
LOCAL_TIMEZONE=[to see local timezones](https://docs.diladele.com/docker/timezones.html)
134135

135136
DIRECTORY_PATH=```pwd``` at command line\
136137
DATABASE_IMAGE_NAME=```mariadb``` or ```mysql```\
137138
DATABASE_CONT_NAME=```mariadb```, ```mysql``` or ```custom name```\
138139
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\
140140
DATABASE_ADMIN_COMMANDLINE=```mariadb-admin``` for mariadb, ```mysqladmin``` for mysql\
141-
VARNISH_VERSION=```latest``` for centos version 9+ and fedora, ```stable``` for the others
141+
SSL_SNIPPET=```echo 'Generated Self-signed SSL Certificate for localhost'``` for localhost\
142+
SSL_SNIPPET=```certbot certonly --webroot --webroot-path /tmp/acme-challenge --rsa-key-size 4096 --non-interactive --agree-tos --no-eff-email --force-renewal --email ${LETSENCRYPT_EMAIL} -d ${DOMAIN_NAME} -d www.${DOMAIN_NAME}``` for remotehost
142143

143144
and
144145

@@ -150,7 +151,7 @@ change example.com to your domain name in ```./phpmyadmin/apache2/sites-availabl
150151
```
151152
cp ./database/phpmyadmin/sql/create_tables.sql.template.example ./database/phpmyadmin/sql/create_tables.sql.template
152153
```
153-
change pma_controluser, db_authentication_plugin and db_authentication_password in ```./database/phpmyadmin/sql/create_tables.sql.template``` file.
154+
change pma_controluser and db_authentication_password in ```./database/phpmyadmin/sql/create_tables.sql.template``` file.
154155

155156
### Installation
156157

@@ -160,6 +161,8 @@ Firstly: will create external volume
160161
docker volume create --driver local --opt type=none --opt device=${PWD}/certbot --opt o=bind certbot-etc
161162
```
162163

164+
for localhost ssl: Generate Self-signed SSL Certificate with guide [mkcert repository](https://github.com/FiloSottile/mkcert).
165+
163166
```
164167
docker compose up -d
165168
```
@@ -254,6 +257,14 @@ to remove portainer and the other images:
254257
docker rmi $(docker image ls -q)
255258
```
256259

260+
### Logs containers
261+
262+
To fetch the logs of a container.
263+
264+
```
265+
docker container logs container_name_or_id
266+
```
267+
257268
### Project from existing source
258269

259270
Copy all files into a new directory:
@@ -288,7 +299,7 @@ You should make changes custom host configurations ```./php-fpm/php-fpm.d/z-www.
288299
docker container restart laminas
289300
```
290301

291-
add and/or remove laminas site folders and files with any ftp client program in ```./laminas/webapp``` folder.
302+
add and/or remove laminas site folders and files with any ftp client program in ```./laminas``` folder.
292303
<br />You can also visit `https://example.com` to access website after starting the containers.
293304

294305
#### Proxy
@@ -323,9 +334,9 @@ Redis host = redis
323334

324335
Redis host port = 6379
325336

326-
[https://docs.laminas.dev/laminas-cache/v3/storage/adapter/#redis-adapter](https://docs.laminas.dev/laminas-cache/v3/storage/adapter/#redis-adapter)
337+
[https://docs.laminas.dev/laminas-cache/v4/storage/adapter/#redis-adapter](https://docs.laminas.dev/laminas-cache/v4/storage/adapter/#redis-adapter)
327338

328-
#### Cache
339+
#### Cache
329340

330341
[https://docs.laminas.dev/laminas-cache/](https://docs.laminas.dev/laminas-cache/)
331342

docker-compose.yml

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
version: '3.7'
2-
31
services:
42

53
laminas:
@@ -32,15 +30,15 @@ services:
3230
test: ["CMD-SHELL", "/bin/pidof php-fpm > /dev/null || exit 1"]
3331
interval: 5s
3432
timeout: 5s
35-
retries: 50
33+
retries: 100
3634
environment:
3735
TZ: '${LOCAL_TIMEZONE}'
3836
labels:
3937
- 'docker-volume-backup.stop-during-backup=true'
4038
command: >
41-
bash -c "apt-get update && sh /tmp/packagecheck.sh 'zip unzip' && curl -sSL https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions -o - | sh -s intl pdo_mysql && curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer &&
42-
if [ \"$$(ls -A ${WEBSERVER_DOC_ROOT}/public)\" ]; then composer update --working-dir=${WEBSERVER_DOC_ROOT}; else rm -f ${WEBSERVER_DOC_ROOT}/README.md && composer create-project -s stable laminas/laminas-mvc-skeleton . --working-dir=${WEBSERVER_DOC_ROOT} --no-interaction && composer require laminas/laminas-db laminas/laminas-cache --working-dir=${WEBSERVER_DOC_ROOT} --no-interaction; fi;
43-
grep -qe 'date.timezone = ${LOCAL_TIMEZONE}' ${PHP_INI_DIR_PREFIX}/php/conf.d/security.ini || echo 'date.timezone = ${LOCAL_TIMEZONE}' >> ${PHP_INI_DIR_PREFIX}/php/conf.d/security.ini; php-fpm"
39+
bash -c "apt-get update && sh /tmp/packagecheck.sh 'zip unzip git libzip-dev libicu-dev' && curl -sSL https://github.com/mlocati/docker-php-extension-installer/releases/latest/download/install-php-extensions -o - | sh -s intl pdo_mysql redis && curl -sS https://getcomposer.org/installer | php && mv composer.phar /usr/local/bin/composer &&
40+
if [ \"$$(ls -A ${WEBSERVER_DOC_ROOT}/public)\" ]; then composer update --working-dir=${WEBSERVER_DOC_ROOT}; else rm -f ${WEBSERVER_DOC_ROOT}/README.md && composer create-project -s stable laminas/laminas-mvc-skeleton . --working-dir=${WEBSERVER_DOC_ROOT} --no-interaction && composer require laminas/laminas-db:* laminas/laminas-developer-tools --working-dir=${WEBSERVER_DOC_ROOT} --no-interaction && composer require laminas/laminas-cache-storage-adapter-redis --working-dir=${WEBSERVER_DOC_ROOT} --no-interaction; fi;
41+
grep -qxF 'date.timezone = ${LOCAL_TIMEZONE}' ${PHP_INI_DIR_PREFIX}/php/conf.d/security.ini || echo 'date.timezone = ${LOCAL_TIMEZONE}' >> ${PHP_INI_DIR_PREFIX}/php/conf.d/security.ini; php-fpm"
4442
4543
webserver:
4644
depends_on:
@@ -84,8 +82,7 @@ services:
8482
retries: 20
8583
environment:
8684
TZ: '${LOCAL_TIMEZONE}'
87-
entrypoint: /bin/sh -c "certbot certonly --webroot --webroot-path /tmp/acme-challenge --rsa-key-size 4096 --non-interactive --agree-tos --no-eff-email --force-renewal --email ${LETSENCRYPT_EMAIL} -d ${DOMAIN_NAME} -d www.${DOMAIN_NAME};
88-
trap exit TERM; while :; do certbot renew --dry-run; sleep 12h & wait $${!}; done;"
85+
entrypoint: /bin/sh -c "${SSL_SNIPPET}; trap exit TERM; while :; do certbot renew --dry-run; sleep 12h & wait $${!}; done;"
8986

9087
proxy:
9188
depends_on:
@@ -168,7 +165,7 @@ services:
168165
bash -c "echo ${PMA_HTPASSWD_USERNAME}:phpmyadmin:$$( printf \"%s:%s:%s\" \"${PMA_HTPASSWD_USERNAME}\" \"phpmyadmin\" \"${PMA_HTPASSWD_PASSWORD}\" | md5sum | awk '{print $$1}' ) > ${PMA_CONF_FOLDER}/.htpasswd
169166
&& printf 'AuthType Digest\\nAuthName \"phpmyadmin\"\\nAuthDigestProvider file\\nAuthUserFile ${PMA_CONF_FOLDER}/.htpasswd\\nRequire valid-user\\n' > ${WEBSERVER_DOC_ROOT}/.htaccess && a2enmod auth_digest;
170167
mkdir -p ${WEBSERVER_DOC_ROOT}/../upload && chown www-data:www-data ${WEBSERVER_DOC_ROOT}/../upload && chmod a+w ${WEBSERVER_DOC_ROOT}/../upload; mkdir -p ${WEBSERVER_DOC_ROOT}/../save && chown www-data:www-data ${WEBSERVER_DOC_ROOT}/../save && chmod a+w ${WEBSERVER_DOC_ROOT}/../save;
171-
grep -qxF 'ServerName 127.0.0.1' ${APACHE_CONFDIR_PREFIX}/apache2.conf || echo -e '\\nServerName 127.0.0.1' >> ${APACHE_CONFDIR_PREFIX}/apache2.conf; grep -qe 'date.timezone = ${LOCAL_TIMEZONE}' ${PHP_INI_DIR_PREFIX}/php/conf.d/security.ini || echo 'date.timezone = ${LOCAL_TIMEZONE}' >> ${PHP_INI_DIR_PREFIX}/php/conf.d/security.ini;
168+
grep -qxF 'ServerName 127.0.0.1' ${APACHE_CONFDIR_PREFIX}/apache2.conf || echo -e '\\nServerName 127.0.0.1' >> ${APACHE_CONFDIR_PREFIX}/apache2.conf; grep -qxF 'date.timezone = ${LOCAL_TIMEZONE}' ${PHP_INI_DIR_PREFIX}/php/conf.d/security.ini || echo 'date.timezone = ${LOCAL_TIMEZONE}' >> ${PHP_INI_DIR_PREFIX}/php/conf.d/security.ini;
172169
a2enmod ssl && a2ensite default-ssl && a2dissite 000-default && /docker-entrypoint.sh 'apache2-foreground'"
173170
174171
database:
@@ -204,7 +201,7 @@ services:
204201
- "docker-volume-backup.stop-during-backup=true"
205202
- "docker-volume-backup.archive-pre=/bin/sh -c 'mysqldump -uroot -p${MYSQL_ROOT_PASSWORD} --all-databases > /tmp/backup/db_backup_data.sql'"
206203
- "docker-volume-backup.exec-label=database"
207-
command: bash -c "${DATABASE_PACKAGE_MANAGER} && export PMA_CONTROLUSER=${PMA_CONTROLUSER} export PMA_CONTROLPASS=${PMA_CONTROLPASS} && envsubst '$$PMA_CONTROLUSER,$$PMA_CONTROLPASS' < /docker-entrypoint-initdb.d/create_tables.sql.template > /docker-entrypoint-initdb.d/create_tables.sql && docker-entrypoint.sh --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci --default-authentication-plugin=${DATABASE_AUTHENTICATION_PLUGIN}"
204+
command: bash -c "${DATABASE_PACKAGE_MANAGER} && chmod 0444 ${MYSQL_CONF_PREFIX}/z-mysql.cnf && export PMA_CONTROLUSER=${PMA_CONTROLUSER} export PMA_CONTROLPASS=${PMA_CONTROLPASS} && envsubst '$$PMA_CONTROLUSER,$$PMA_CONTROLPASS' < /docker-entrypoint-initdb.d/create_tables.sql.template > /docker-entrypoint-initdb.d/create_tables.sql && docker-entrypoint.sh --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci"
208205

209206
redis:
210207
image: redis:latest

0 commit comments

Comments
 (0)