-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
141 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
DOMAIN=wp.mihandoost.com | ||
|
||
NGINX_VERSION=1.21 | ||
NGINX_MEMORY_LIMIT=256m | ||
|
||
NGINX_ENTRYPOINT_WORKER_PROCESSES_AUTOTUNE=1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# @alwatr/static-server container |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -Eeuo pipefail | ||
trap "echo '❌ Error'" ERR | ||
|
||
TIMEFORMAT="done in %Rs" | ||
thisPath="$(dirname "$0")" | ||
cd $thisPath | ||
ls -lahF | ||
|
||
echoStep () { | ||
echo "🔹 $1" | ||
} | ||
|
||
echoStep "Preparing..." | ||
|
||
[ ! -d _data ] && mkdir _data | ||
[ -f _data/wp-config.php ] && mv -fv "_data/wp-config.php" "_data/wp-config.php.bak" | ||
|
||
time docker compose pull | ||
time docker compose build --pull | ||
|
||
echoStep "Starting..." | ||
|
||
time docker compose up --detach --remove-orphans --force-recreate | ||
|
||
echoStep "Fix permitions..." | ||
|
||
time docker compose exec php "fix-permition.sh" || true | ||
|
||
echoStep "Done" | ||
|
||
docker compose logs --tail=300 --follow || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,96 @@ | ||
networks: | ||
internal: | ||
alwatr-private-network: | ||
name: alwatr-private-network | ||
external: true | ||
alwatr-public-network: | ||
name: alwatr-public-network | ||
external: true | ||
|
||
services: | ||
nginx: | ||
build: | ||
context: ./nginx | ||
args: | ||
- NGINX_VERSION=${NGINX_VERSION} | ||
|
||
networks: | ||
- internal | ||
- alwatr-public-network | ||
|
||
restart: unless-stopped | ||
|
||
depends_on: | ||
- php | ||
|
||
cpu_shares: 2048 | ||
mem_limit: ${NGINX_MEMORY_LIMIT} | ||
|
||
volumes: | ||
- type: bind | ||
source: ./_data/ | ||
target: /var/www/html/ | ||
|
||
tmpfs: | ||
- /var/cache | ||
|
||
logging: | ||
driver: json-file | ||
options: | ||
max-size: '10m' | ||
max-file: '2' | ||
|
||
labels: | ||
traefik.enable: true | ||
traefik.port: 80 | ||
traefik.frontend.rule: Host:${DOMAIN} | ||
traefik.frontend.entryPoints: http, https | ||
traefik.frontend.redirect.entryPoint: https | ||
|
||
php: | ||
build: | ||
context: ./php | ||
args: | ||
- PHP_VERSION=${PHP_VERSION} | ||
- WORDPRESS_VERSION=${WORDPRESS_VERSION} | ||
- SOURCEGUARDIAN_LOADER=${SOURCEGUARDIAN_LOADER} | ||
- IONCUBE_LOADER=${IONCUBE_LOADER} | ||
|
||
networks: | ||
internal: | ||
aliases: | ||
- wordpress-php-fpm | ||
alwatr-private-network: | ||
|
||
restart: unless-stopped | ||
|
||
cpu_shares: 1024 | ||
mem_limit: ${PHP_MEMORY_LIMIT} | ||
|
||
volumes: | ||
- type: bind | ||
source: ./_data/ | ||
target: /var/www/html/ | ||
|
||
tmpfs: | ||
- /tmp | ||
|
||
env_file: | ||
- .env | ||
|
||
logging: | ||
driver: json-file | ||
options: | ||
max-size: '10m' | ||
max-file: '2' | ||
|
||
environment: | ||
WORDPRESS_CONFIG_EXTRA: | | ||
/* Alwatr Setting */ | ||
define('WP_CACHE', true); | ||
define('WP_POST_REVISIONS', 2); | ||
define('IMAGE_EDIT_OVERWRITE', true); | ||
define('FORCE_SSL_LOGIN', false); | ||
define('FORCE_SSL_ADMIN', false); | ||
define('WP_MEMORY_LIMIT', '256M'); | ||
define('WP_MAX_MEMORY_LIMIT', '256M'); # admin dashboard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
source ../lib/deploy.sh |