Skip to content

Commit

Permalink
fix(package): eslint command
Browse files Browse the repository at this point in the history
  • Loading branch information
AliMD committed Aug 24, 2022
1 parent 4d1237c commit c74be93
Show file tree
Hide file tree
Showing 6 changed files with 141 additions and 2 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
"pm": "npm-run-all --sequential clean build ver-minor publish",
"pp": "npm-run-all --sequential clean build ver-patch publish",
"lint": "npm-run-all --sequential lint:*",
"lint:ts": "eslint **/*.ts",
"lint:ts": "eslint \"**/*.ts\"",
"build": "npm-run-all --sequential build:ts && lerna run build",
"build:ts": "tsc --build",
"format": "npm-run-all --sequential format:prettier format:eslint",
"format:eslint": "eslint **/*.ts --fix",
"format:eslint": "eslint \"**/*.ts\" --fix",
"format:prettier": "prettier \"**/*.{html,json,md,ts}\" --ignore-path ./.eslintignore --write",
"clean": "yarn build:ts --clean && lerna run clean && rimraf \"{packages,demo}/**/*.{js,d.ts,map}\" \"{packages,demo}/**/.tsbuildinfo\" \"{packages,demo}/**/node_modules/\"",
"serve:dev": "web-dev-server --config dev-server.mjs",
Expand Down
6 changes: 6 additions & 0 deletions packages/classic-cloud/static-file/.env.example
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
1 change: 1 addition & 0 deletions packages/classic-cloud/static-file/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# @alwatr/static-server container
33 changes: 33 additions & 0 deletions packages/classic-cloud/static-file/_up.sh
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
96 changes: 96 additions & 0 deletions packages/classic-cloud/static-file/compose.yml
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
3 changes: 3 additions & 0 deletions packages/classic-cloud/static-file/deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/usr/bin/env bash

source ../lib/deploy.sh

0 comments on commit c74be93

Please sign in to comment.