Compare commits
140 Commits
79d68ae831
...
master
Author | SHA1 | Date | |
---|---|---|---|
4c410fa89f | |||
92cefd6fcd | |||
94fe970cd3 | |||
537b5ad4be | |||
cb5c989830 | |||
3ed6f5dfff | |||
8299d7276a | |||
50148659c8 | |||
65c9b61c51 | |||
e699876976 | |||
21140eab2d | |||
1ea5e96fcb | |||
49e44c9229 | |||
57c56567cf | |||
2695d1f759 | |||
3cb9b6e925 | |||
4e0c2dbfc4 | |||
3faf8a698a | |||
f3b9303754 | |||
0e1bd3246d | |||
184fc3dc2d | |||
2db44cb74e | |||
e17103f4ab | |||
e59e976cd9 | |||
33a0756530 | |||
5c1c94bfe2 | |||
46a0154871 | |||
25368c8408 | |||
c37ff438d8 | |||
b0cd920e41 | |||
dc3b0a76a7 | |||
35baceb62a | |||
f63747e59f | |||
1677ffe648 | |||
32b98ae170 | |||
5dcd3a131c | |||
a3f7465955 | |||
a244fec29a | |||
eb64cd702a | |||
fd7c8b9ac1 | |||
2049580005 | |||
b1b2e1d501 | |||
baa258b8fb | |||
cea2dbb653 | |||
217250c0e0 | |||
a87fc51072 | |||
d29546cb34 | |||
1b35c6927c | |||
767aa7ba37 | |||
1771877fe8 | |||
fc044a1185 | |||
38cb19818a | |||
c07f142607 | |||
ca9f40667b | |||
7de00f8385 | |||
0bbc4eedd7 | |||
42d0209290 | |||
75b35e22a9 | |||
97609898e1 | |||
15c6a8eb53 | |||
829107e5f5 | |||
ee023006ff | |||
dbe3a916f1 | |||
9fab9307b6 | |||
71d4b97c46 | |||
c3d132b120 | |||
d625dbb158 | |||
aa74376503 | |||
9bc71f7b2d | |||
c11eb7bf7c | |||
b0683316de | |||
2b24d70652 | |||
db86932c71 | |||
57cc040b3a | |||
04d399489b | |||
de93f6746b | |||
075f50b08c | |||
63500c4fff | |||
8c72843191 | |||
db2c2aac82 | |||
3cd2603bf3 | |||
d6d86179e6 | |||
2d0fc4385d | |||
54a04feae7 | |||
6743629602 | |||
5cf2889c55 | |||
ec68f3549e | |||
a2fb8827c3 | |||
4201d657d6 | |||
4a0dbb92d8 | |||
4bac781c3b | |||
471b5c1502 | |||
b85b503015 | |||
cd38a60396 | |||
be1385a4a5 | |||
cbb1d79584 | |||
e6477518d2 | |||
0f9a528f62 | |||
ea0ee2c28a | |||
d6b28eeb74 | |||
b10442065d | |||
8c8e29a918 | |||
1945097f11 | |||
3535a09ce9 | |||
93eddcdf84 | |||
10231ac87b | |||
c5e6559db2 | |||
73e2eb7853 | |||
db0bb333fa | |||
0a3a980f8b | |||
07e3499946 | |||
9103721fbe | |||
4ae9b30644 | |||
e9596a7e11 | |||
5f1e9498c8 | |||
ec31427cb7 | |||
3955c89a85 | |||
57ebccad04 | |||
0609ced666 | |||
2a88fe11f2 | |||
ff0b62ed49 | |||
fb9e1c6f4f | |||
f68bf45fae | |||
e051d0100c | |||
29a58620f5 | |||
cd422e4e6b | |||
5720d9376b | |||
f89b232d7b | |||
9f0f96a499 | |||
f3139e9716 | |||
998509196d | |||
fc8524d265 | |||
abefce6dd2 | |||
cb300955d7 | |||
c5143e9949 | |||
e252554642 | |||
c57f3421e4 | |||
4687eb8daa | |||
3279b86b59 | |||
feac856355 |
50
.env.example
50
.env.example
@ -1,38 +1,30 @@
|
||||
# Enter your Docker Host IP (will be appended to /etc/hosts). Default is `10.0.75.1`
|
||||
DOCKER_HOST_IP=172.20.0.1
|
||||
# Enter your gateway IP (your host IP under from docker containers) - that need for correctly worked xdebug from cli
|
||||
# For detect that IP use: docker network inspect structure_default | grep Gateway | xargs | cut -d ' ' -f2
|
||||
# For UFW allowing ports on the host system: ufw allow to 172.18.0.1 port 9000,9003
|
||||
DOCKER_HOST_IP=172.18.0.1
|
||||
PROJECTS_DIR=/home/youruser/PhpstormProjects
|
||||
PYTHON_PROJECTS_DIR=/home/dimti/PythonProjects
|
||||
|
||||
### Common ###############################################
|
||||
CUSTOM_TZ=Europe/Moscow
|
||||
CUSTOM_LOCALE=ru_RU.UTF-8
|
||||
|
||||
### WORKSPACE #############################################
|
||||
|
||||
### WORKSPACE #############################################
|
||||
WORKSPACE_PHP_VERSION=7.3
|
||||
WORKSPACE_PUID=1000
|
||||
WORKSPACE_PGID=1000
|
||||
WORKSPACE_TIMEZONE=Europe/Moscow
|
||||
WORKSPACE_COMPOSER_GLOBAL_INSTALL=true
|
||||
WORKSPACE_COMPOSER_AUTH=false
|
||||
WORKSPACE_COMPOSER_REPO_PACKAGIST=
|
||||
WORKSPACE_INSTALL_WP_CLI=true
|
||||
WORKSPACE_INSTALL_XDEBUG=false
|
||||
|
||||
WORKSPACE_INSTALL_YADM=true
|
||||
WORKSPACE_INSTALL_FINE_UTILS=true
|
||||
WORKSPACE_INSTALL_SSH=true
|
||||
WORKSPACE_SSH_PASSPHRAZE=RSfndC66KmuRPRtSXOEe
|
||||
WORKSPACE_INSTALL_FSWATCH=false
|
||||
WORKSPACE_INSTALL_NODE=true
|
||||
WORKSPACE_NODE_VERSION=lts/carbon
|
||||
WORKSPACE_NPM_REGISTRY=
|
||||
WORKSPACE_INSTALL_YARN=true
|
||||
WORKSPACE_YARN_VERSION=latest
|
||||
WORKSPACE_INSTALL_GULP=true
|
||||
WORKSPACE_INSTALL_MYSQL_CLIENT=true
|
||||
WORKSPACE_INSTALL_PING=true
|
||||
WORKSPACE_INSTALL_PYTHON=true
|
||||
|
||||
WORKSPACE_PHP_OPT_MEMORY_LIMIT=-1
|
||||
|
||||
### PHP-FPM #############################################
|
||||
INSTALL_XDEBUG=true
|
||||
INSTALL_REDIS=true
|
||||
INSTALL_PEAR_MAIL=true
|
||||
INSTALL_ZIP=true
|
||||
INSTALL_BZ2=true
|
||||
INSTALL_INTL=true
|
||||
PHP_OPT_SHORT_OPEN_TAG=On
|
||||
PHP_OPT_MEMORY_LIMIT=512M
|
||||
|
||||
PHP_OPT_POST_MAX_SIZE=800M
|
||||
PHP_OPT_UPLOAD_MAX_FILESIZE=200M
|
||||
|
||||
PHP_OPT_MAX_EXECUTION_TIME=600
|
||||
PHP_OPT_MEMORY_LIMIT=500M
|
||||
PHP_OPT_UPLOAD_MAX_FILESIZE=20M
|
||||
|
8
.gitignore
vendored
8
.gitignore
vendored
@ -1,4 +1,6 @@
|
||||
/.idea
|
||||
/dockerfiles/ypt-encoder
|
||||
/docker-compose.yml
|
||||
/.env
|
||||
/.env
|
||||
/docker-compose*
|
||||
!/docker-compose.base.yml
|
||||
!/docker-compose*.example
|
||||
/config/nginx/includes.d/auth.passwd
|
||||
|
136
README.md
Normal file
136
README.md
Normal file
@ -0,0 +1,136 @@
|
||||
# Prepare
|
||||
|
||||
Copy all example files and dir
|
||||
|
||||
Cop and set your username:
|
||||
`.env.example`
|
||||
|
||||
Choose php version and redis needed redis containers
|
||||
`docker-compose.yml.example`
|
||||
|
||||
`dockerfiles/workspace/crontab-example`
|
||||
|
||||
`dockerfiles/workspace/aliases.sh.example`
|
||||
|
||||
Set your site(s) root-mappings
|
||||
`config/nginx/conf.d/vhosts.conf.example`
|
||||
|
||||
## First
|
||||
Create alias for `docker-compose` command.
|
||||
|
||||
`echo 'alias dc="docker-compose"' >> ~/.bash_aliases`
|
||||
|
||||
Also, you have might be needed include `~/.bash_aliases` in your `~/.bashrc` file.
|
||||
|
||||
Build all
|
||||
|
||||
`dc build`
|
||||
|
||||
## Second
|
||||
|
||||
Create usefully symlinks
|
||||
|
||||
`./create-symlinks.sh`
|
||||
|
||||
## Get composer auth token
|
||||
|
||||
If you do not have composer github auth.json file in `~/.composer` dir. You will need launch the helper-script:
|
||||
|
||||
`./get-composer-auth.sh`
|
||||
|
||||
## Before use and launch
|
||||
|
||||
You need copy `vhosts.conf.example` and edit this file - remove unused roots (or change to existing dirs).
|
||||
Setup correctly nginx config.
|
||||
|
||||
You ready for up containers.
|
||||
|
||||
`dc up -d`
|
||||
|
||||
## Database dumps
|
||||
|
||||
Database dumps must be placement on `./hostfiles` directory.
|
||||
|
||||
## Bash scripts
|
||||
|
||||
After execute created symlinks, you have some enter-points for vulnerable popular tasks.
|
||||
|
||||
### Xdebug
|
||||
For start debugging in php-fpm, also in workspace
|
||||
|
||||
`./xdebug-start.sh [74|81]` - `74` by default
|
||||
|
||||
For start debugging in php-fpm, also in workspace
|
||||
|
||||
`./xdebug-stop.sh` or `./stop-xdebug.sh 81` if you launch start new php version 81
|
||||
|
||||
#### Xdebug with profiler
|
||||
|
||||
Profiler saved your profiles into `/tmp` directory in own container.
|
||||
|
||||
In docker-compose.base.yml exists volume that represent `/tmp` directory to `./data/profiler`.
|
||||
In this case `./data/profiler` must be have `777` chmod`s.
|
||||
|
||||
For starting xdebug with profiler enable you might:
|
||||
|
||||
`./xdebug-start.sh 74 1`
|
||||
|
||||
Or
|
||||
|
||||
`./xdebug-start.sh 74 profiler` if you like
|
||||
|
||||
Second argument must be have any string
|
||||
|
||||
For disable profiler - just simple launch
|
||||
|
||||
`./xdebug-quit.sh`
|
||||
|
||||
|
||||
### Mysql
|
||||
|
||||
For import dumps from `hostfiles` directory you might be enter to mysql console:
|
||||
|
||||
`./mysql.sh`
|
||||
|
||||
Change you needed database and source to the `*.sql` dump.
|
||||
|
||||
`use mydatabase`
|
||||
|
||||
`source /hostfiles/mydatabase.sql`
|
||||
|
||||
Dump must be extracted before source in mysql-cli
|
||||
|
||||
### Workspace
|
||||
|
||||
For execute composer update|install or nodejs operations, also yarn, npm and all node-builds.
|
||||
You might use `workspace`-container
|
||||
|
||||
For the enter to workspace container with php 7.4 you need launch usefully helper script in your home directory:
|
||||
|
||||
`./enter-to-workspace.sh`
|
||||
|
||||
For enter to `workspace` with php7.3 you need pass `73` container name suffix
|
||||
|
||||
`./enter-to-workspace.sh 73`
|
||||
|
||||
### Nginx
|
||||
|
||||
For restart `nginx` after some changes in nginx configuration, you might:
|
||||
|
||||
`./restart-nginx.sh`
|
||||
|
||||
### Elastic
|
||||
|
||||
Copy example
|
||||
|
||||
Launch:
|
||||
|
||||
`dc -f docker-compose.elastic.yml up -d elastic`
|
||||
|
||||
## Src build need DOCKER_BUILDKIT
|
||||
|
||||
If you want build own workspace image. You need export environment variable
|
||||
|
||||
`export DOCKER_BUILDKIT=1`
|
||||
|
||||
more info https://github.com/edrevo/dockerfile-plus
|
15
bash/_docker-cmd.sh
Normal file
15
bash/_docker-cmd.sh
Normal file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
# Grab OS type
|
||||
if [[ "$(uname)" == "Darwin" ]]; then
|
||||
OS_TYPE="OSX"
|
||||
else
|
||||
OS_TYPE=$(expr substr $(uname -s) 1 5)
|
||||
fi
|
||||
|
||||
DOCKER_CMD=docker
|
||||
|
||||
if [[ $OS_TYPE == "MINGW" ]]; then
|
||||
DOCKER_CMD="winpty docker"
|
||||
fi
|
||||
|
||||
export DOCKER_CMD
|
5
bash/_helpers.sh
Normal file
5
bash/_helpers.sh
Normal file
@ -0,0 +1,5 @@
|
||||
function dot_version() {
|
||||
sed -r 's/^([[:digit:]])/\1./g' <<< $1
|
||||
}
|
||||
|
||||
export -f dot_version
|
2
bash/change-hosts-on-windows.sh
Normal file
2
bash/change-hosts-on-windows.sh
Normal file
@ -0,0 +1,2 @@
|
||||
#!/bin/bash
|
||||
sed -i 's/.* host.docker.internal/127.0.0.1 host.docker.internal/' /c/Windows/System32/drivers/etc/hosts
|
15
bash/db-restart.sh
Executable file
15
bash/db-restart.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)"
|
||||
|
||||
. $DIR/bash/_docker-cmd.sh || {
|
||||
echo "no docker cmd is presented" && exit 1
|
||||
}
|
||||
|
||||
CONTAINER=$(docker ps | grep db | awk '{print $1}')
|
||||
|
||||
if [[ -z "${CONTAINER}" ]]; then
|
||||
echo "Unable to find container: db"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$DOCKER_CMD restart ${CONTAINER}
|
9
bash/dump.sh
Executable file
9
bash/dump.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
CONTAINER=$(docker ps | grep mariadb | awk '{print $1}')
|
||||
|
||||
if [[ -z "${CONTAINER}" ]]; then
|
||||
echo "Unable to find container: db"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
docker exec -ti ${CONTAINER} mariadb-dump -u root -p123456 $1
|
@ -1,3 +1,19 @@
|
||||
#!/bin/bash
|
||||
cd $HOME/structure
|
||||
docker-compose exec workspace su laradock
|
||||
SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
|
||||
|
||||
. $SCRIPT_DIR/_docker-cmd.sh || {
|
||||
echo "no docker cmd is presented" && exit 1
|
||||
}
|
||||
|
||||
PHP_VERSION=$1 # Without dot
|
||||
|
||||
if [[ -z "${PHP_VERSION}" ]]; then PHP_VERSION=81; fi
|
||||
|
||||
CONTAINER=$(docker ps | grep workspace${PHP_VERSION} | awk '{print $1}')
|
||||
|
||||
if [[ -z "${CONTAINER}" ]]; then
|
||||
echo "Unable to find container: workspace${PHP_VERSION}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$DOCKER_CMD exec -ti ${CONTAINER} su laradock
|
||||
|
15
bash/mariadb.sh
Executable file
15
bash/mariadb.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
|
||||
|
||||
. $SCRIPT_DIR/_docker-cmd.sh || {
|
||||
echo "no docker cmd is presented" && exit 1
|
||||
}
|
||||
|
||||
CONTAINER=$(docker ps | grep mariadb | awk '{print $1}')
|
||||
|
||||
if [[ -z "${CONTAINER}" ]]; then
|
||||
echo "Unable to find container: db"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$DOCKER_CMD exec -ti ${CONTAINER} bash -c 'LANG=ru_RU.UTF-8 mariadb -u root -p123456'
|
@ -1,3 +1,29 @@
|
||||
#!/bin/bash
|
||||
cd $HOME/structure
|
||||
docker-compose exec db mysql -u root -p123456
|
||||
SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
|
||||
|
||||
. $SCRIPT_DIR/_docker-cmd.sh || {
|
||||
echo "no docker cmd is presented" && exit 1
|
||||
}
|
||||
|
||||
CONTAINER=$(docker ps | grep mariadb | awk '{print $1}')
|
||||
|
||||
if [[ -z "${CONTAINER}" ]]; then
|
||||
echo "Unable to find container: db"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
MYSQL_CMD='mysql -u root -p123456'
|
||||
|
||||
SQL_QUERY=$1
|
||||
|
||||
if [[ -n "${SQL_QUERY}" ]]; then
|
||||
MYSQL_CMD="${MYSQL_CMD} -e \"${SQL_QUERY}\""
|
||||
|
||||
SELECTED_DB=$2
|
||||
|
||||
if [[ -n "${SELECTED_DB}" ]]; then
|
||||
MYSQL_CMD="${MYSQL_CMD} \"${SELECTED_DB}\""
|
||||
fi
|
||||
fi
|
||||
|
||||
$DOCKER_CMD exec -ti ${CONTAINER} bash -c "LANG=ru_RU.UTF-8 ${MYSQL_CMD}"
|
||||
|
6
bash/nginx-ssl-gen.sh
Normal file
6
bash/nginx-ssl-gen.sh
Normal file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)"
|
||||
|
||||
cd ${DIR}/config/nginx/ssl.d && \
|
||||
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 3650 -nodes -subj \
|
||||
"/C=XX/ST=RU/L=RU/O=WPS/OU=Dev/CN=test"
|
22
bash/pm2-restart.sh
Executable file
22
bash/pm2-restart.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)"
|
||||
|
||||
. $DIR/bash/_docker-cmd.sh || {
|
||||
echo "no docker cmd is presented" && exit 1
|
||||
}
|
||||
|
||||
PM2_SERVICE=$1
|
||||
|
||||
if [[ -z "${PM2_SERVICE}" ]]; then
|
||||
echo "Usage: $(basename $0) NODEJS_PROJECT_NAME"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CONTAINER=$(docker ps | grep "pm2-${PM2_SERVICE}" | awk '{print $1}')
|
||||
|
||||
if [[ -z "${CONTAINER}" ]]; then
|
||||
echo "Unable to find container: db"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$DOCKER_CMD restart ${CONTAINER}
|
22
bash/python-restart.sh
Executable file
22
bash/python-restart.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)"
|
||||
|
||||
. $DIR/bash/_docker-cmd.sh || {
|
||||
echo "no docker cmd is presented" && exit 1
|
||||
}
|
||||
|
||||
PYTHON_SERVICE=$1
|
||||
|
||||
if [[ -z "${PYTHON_SERVICE}" ]]; then
|
||||
echo "Usage: $(basename $0) PYTHON_PROJECT_NAME"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CONTAINER=$(docker ps | grep "python-${PYTHON_SERVICE}" | awk '{print $1}')
|
||||
|
||||
if [[ -z "${CONTAINER}" ]]; then
|
||||
echo "Unable to find container: db"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$DOCKER_CMD restart ${CONTAINER}
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
cd $HOME/structure
|
||||
./dockerfiles/php-fpm/xdebug.sh stop && cd
|
@ -1,3 +1,15 @@
|
||||
#!/bin/bash
|
||||
cd $HOME/structure
|
||||
docker-compose exec web nginx -s reload
|
||||
SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
|
||||
|
||||
. $SCRIPT_DIR/_docker-cmd.sh || {
|
||||
echo "no docker cmd is presented" && exit 1
|
||||
}
|
||||
|
||||
CONTAINER=$(docker ps | grep nginx | awk '{print $1}')
|
||||
|
||||
if [[ -z "${CONTAINER}" ]]; then
|
||||
echo "Unable to find container: nginx"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$DOCKER_CMD exec -ti ${CONTAINER} nginx -s reload
|
20
bash/root-onto-workspace.sh
Normal file
20
bash/root-onto-workspace.sh
Normal file
@ -0,0 +1,20 @@
|
||||
#!/bin/bash
|
||||
SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
|
||||
|
||||
. $SCRIPT_DIR/_docker-cmd.sh || {
|
||||
echo "no docker cmd is presented" && exit 1
|
||||
}
|
||||
|
||||
PHP_VERSION=$1 # Without dot
|
||||
|
||||
if [[ -z "${PHP_VERSION}" ]]; then PHP_VERSION=74; fi
|
||||
|
||||
CONTAINER=$(docker ps | grep workspace${PHP_VERSION} | awk '{print $1}')
|
||||
|
||||
|
||||
if [[ -z "${CONTAINER}" ]]; then
|
||||
echo "Unable to find container: workspace${PHP_VERSION}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
$DOCKER_CMD exec -ti ${CONTAINER}
|
@ -1,3 +0,0 @@
|
||||
#!/bin/bash
|
||||
cd $HOME/structure
|
||||
./dockerfiles/php-fpm/xdebug.sh start && cd
|
11
bash/tail-db-general-log.sh
Executable file
11
bash/tail-db-general-log.sh
Executable file
@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
# Not working on windows symlinks
|
||||
DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)"
|
||||
|
||||
GENERAL_LOG_FILE_PATH="${DIR}/log/mariadb/mariadb.log"
|
||||
|
||||
sudo truncate -s 0 $GENERAL_LOG_FILE_PATH
|
||||
|
||||
clear
|
||||
|
||||
sudo tail -f $GENERAL_LOG_FILE_PATH | grep -Ev "(Close|Prepare)"
|
9
bash/tail-nginx-access-log.sh
Executable file
9
bash/tail-nginx-access-log.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
# Not working on windows symlinks
|
||||
DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)"
|
||||
|
||||
LOG_FILE_PATH="${DIR}/log/nginx/access.log"
|
||||
|
||||
clear
|
||||
|
||||
tail -f $LOG_FILE_PATH
|
9
bash/tail-nginx-error-log.sh
Executable file
9
bash/tail-nginx-error-log.sh
Executable file
@ -0,0 +1,9 @@
|
||||
#!/bin/bash
|
||||
# Not working on windows symlinks
|
||||
DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)"
|
||||
|
||||
LOG_FILE_PATH="${DIR}/log/nginx/error.log"
|
||||
|
||||
clear
|
||||
|
||||
tail -f $LOG_FILE_PATH
|
24
bash/update-composer.sh
Executable file
24
bash/update-composer.sh
Executable file
@ -0,0 +1,24 @@
|
||||
#!/bin/bash
|
||||
SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
|
||||
|
||||
. $SCRIPT_DIR/_docker-cmd.sh || {
|
||||
echo "no docker cmd is presented" && exit 1
|
||||
}
|
||||
|
||||
PHP_VERSION=$1 # Without dot
|
||||
COMPOSER_VERSION=$2
|
||||
|
||||
if [[ -z "${PHP_VERSION}" ]]; then PHP_VERSION=74; fi
|
||||
|
||||
CONTAINER=$(docker ps | grep workspace${PHP_VERSION} | awk '{print $1}')
|
||||
|
||||
if [[ -z "${CONTAINER}" ]]; then
|
||||
echo "Unable to find container: workspace${PHP_VERSION}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [[ -z "${COMPOSER_VERSION}" ]]; then
|
||||
COMPOSER_VERSION=1
|
||||
fi
|
||||
|
||||
$DOCKER_CMD exec -ti "${CONTAINER}" composer self-update --${COMPOSER_VERSION}
|
45
bash/xdebug-quit.sh
Executable file
45
bash/xdebug-quit.sh
Executable file
@ -0,0 +1,45 @@
|
||||
#!/bin/bash
|
||||
SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
|
||||
|
||||
set -e
|
||||
|
||||
. $SCRIPT_DIR/_helpers.sh || {
|
||||
echo "no helpers" && exit 1
|
||||
}
|
||||
|
||||
cd "$SCRIPT_DIR/.."
|
||||
|
||||
PHP_VERSION=$1
|
||||
|
||||
if [[ -z "${PHP_VERSION}" ]]; then PHP_VERSION=81; fi
|
||||
|
||||
WITH_PROFILER=$2
|
||||
|
||||
PHP_DOT_VERSION=$(dot_version ${PHP_VERSION})
|
||||
|
||||
PHP_FPM_CONTAINER=$(docker ps | grep "php${PHP_VERSION}" | awk '{print $1}')
|
||||
WORKSPACE_CONTAINER=$(docker ps | grep "workspace${PHP_VERSION}" | awk '{print $1}')
|
||||
|
||||
PHP_FPM_XDEBUG_EXT_PATH=/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
|
||||
WORKSPACE_XDEBUG_EXT_PATH=/etc/php/${PHP_DOT_VERSION}/cli/conf.d/20-xdebug.ini
|
||||
|
||||
PHP_FPM_XDEBUG_CONFIG_PATH=/usr/local/etc/php/conf.d/xdebug.ini
|
||||
WORKSPACE_XDEBUG_CONFIG_PATH=/etc/php/${PHP_DOT_VERSION}/cli/conf.d/xdebug.ini
|
||||
|
||||
SED_XDEBUG_ON="sed -i 's/^zend_extension=/;zend_extension=/g'"
|
||||
|
||||
docker exec -it "${PHP_FPM_CONTAINER}" bash -c "${SED_XDEBUG_ON} ${PHP_FPM_XDEBUG_EXT_PATH}"
|
||||
docker exec -it "${WORKSPACE_CONTAINER}" bash -c "${SED_XDEBUG_ON} ${WORKSPACE_XDEBUG_EXT_PATH}"
|
||||
|
||||
echo "Xdebug off: $PHP_VERSION"
|
||||
|
||||
if [ "${PHP_VERSION}" = 74 ]; then
|
||||
SED_PROFILER_OFF="sed -i 's/^xdebug.profiler_enable=.*/xdebug.profiler_enable=0/g'"
|
||||
else
|
||||
SED_PROFILER_OFF="sed -i 's/^xdebug.mode=.*/xdebug.mode=off/g'"
|
||||
fi
|
||||
|
||||
docker exec -it "${PHP_FPM_CONTAINER}" bash -c "${SED_PROFILER_OFF} ${PHP_FPM_XDEBUG_CONFIG_PATH}"
|
||||
docker exec -it "${WORKSPACE_CONTAINER}" bash -c "${SED_PROFILER_OFF} ${WORKSPACE_XDEBUG_CONFIG_PATH}"
|
||||
|
||||
docker restart "${PHP_FPM_CONTAINER}"
|
58
bash/xdebug-start.sh
Executable file
58
bash/xdebug-start.sh
Executable file
@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
# Line above doe not correctly work for this script symlinks
|
||||
#SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
# And symlinks are not working on windows.
|
||||
SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
|
||||
|
||||
set -e
|
||||
|
||||
. $SCRIPT_DIR/_helpers.sh || {
|
||||
echo "no helpers" && exit 1
|
||||
}
|
||||
|
||||
cd "$SCRIPT_DIR/.."
|
||||
|
||||
PHP_VERSION=$1
|
||||
|
||||
if [[ -z "${PHP_VERSION}" ]]; then PHP_VERSION=81; fi
|
||||
|
||||
WITH_PROFILER=$2
|
||||
|
||||
PHP_DOT_VERSION=$(dot_version ${PHP_VERSION})
|
||||
|
||||
PHP_FPM_CONTAINER=$(docker ps | grep "php${PHP_VERSION}" | awk '{print $1}')
|
||||
WORKSPACE_CONTAINER=$(docker ps | grep "workspace${PHP_VERSION}" | awk '{print $1}')
|
||||
|
||||
PHP_FPM_XDEBUG_EXT_PATH=/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini
|
||||
WORKSPACE_XDEBUG_EXT_PATH=/etc/php/${PHP_DOT_VERSION}/cli/conf.d/20-xdebug.ini
|
||||
|
||||
PHP_FPM_XDEBUG_CONFIG_PATH=/usr/local/etc/php/conf.d/xdebug.ini
|
||||
WORKSPACE_XDEBUG_CONFIG_PATH=/etc/php/${PHP_DOT_VERSION}/cli/conf.d/xdebug.ini
|
||||
|
||||
SED_XDEBUG_ON="sed -i 's/^;zend_extension=/zend_extension=/g'"
|
||||
|
||||
docker exec -it "${PHP_FPM_CONTAINER}" bash -c "${SED_XDEBUG_ON} ${PHP_FPM_XDEBUG_EXT_PATH}"
|
||||
docker exec -it "${WORKSPACE_CONTAINER}" bash -c "${SED_XDEBUG_ON} ${WORKSPACE_XDEBUG_EXT_PATH}"
|
||||
|
||||
echo "Turn on xdebug: $PHP_VERSION"
|
||||
|
||||
if [ -n "${WITH_PROFILER}" ]; then
|
||||
echo "Profiler enabled"
|
||||
if [ "${PHP_VERSION}" = 74 ]; then
|
||||
SED_DEBUG_OR_PROFILER_MODE_ON="sed -i 's/^xdebug.profiler_enable=.*/xdebug.profiler_enable=1/g'"
|
||||
else
|
||||
SED_DEBUG_OR_PROFILER_MODE_ON="sed -i 's/^xdebug.mode=.*/xdebug.mode=profile/g'"
|
||||
fi
|
||||
elif [ "${PHP_VERSION}" -ne 74 ]; then
|
||||
SED_DEBUG_OR_PROFILER_MODE_ON="sed -i 's/^xdebug.mode=.*/xdebug.mode=debug/g'"
|
||||
fi
|
||||
|
||||
if [ -n "${SED_DEBUG_OR_PROFILER_MODE_ON}" ]; then
|
||||
docker exec -it "${PHP_FPM_CONTAINER}" bash -c "${SED_DEBUG_OR_PROFILER_MODE_ON} ${PHP_FPM_XDEBUG_CONFIG_PATH}"
|
||||
docker exec -it "${WORKSPACE_CONTAINER}" bash -c "${SED_DEBUG_OR_PROFILER_MODE_ON} ${WORKSPACE_XDEBUG_CONFIG_PATH}"
|
||||
fi
|
||||
|
||||
docker restart "${PHP_FPM_CONTAINER}"
|
||||
|
||||
echo 'Use this for resolve hostname in your IDE debugger:'
|
||||
echo 'export PHP_IDE_CONFIG="serverName=myproject.cli.local.wpstudio.ru"'
|
3
config/dnsmasq/.gitignore
vendored
Normal file
3
config/dnsmasq/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
*
|
||||
!.gitignore
|
||||
!.example
|
10
config/dnsmasq/dnsmasq.conf.example
Normal file
10
config/dnsmasq/dnsmasq.conf.example
Normal file
@ -0,0 +1,10 @@
|
||||
# log all dns queries
|
||||
log-queries
|
||||
# dont use hosts nameservers
|
||||
no-resolv
|
||||
# use google as default nameservers
|
||||
server=8.8.4.4
|
||||
server=8.8.8.8
|
||||
# explicitly define host-ip mappings
|
||||
# line below need real data
|
||||
address=/domain/ip
|
2
config/mariadb/.gitignore
vendored
Normal file
2
config/mariadb/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*.cnf
|
||||
*.cnf.disable
|
3
config/mariadb/90-mysqld.cnf.example
Normal file
3
config/mariadb/90-mysqld.cnf.example
Normal file
@ -0,0 +1,3 @@
|
||||
[mysqld]
|
||||
explicit_defaults_for_timestamp = ON
|
||||
default_time_zone = '+03:00'
|
3
config/mariadb/root-account.cnf.example
Normal file
3
config/mariadb/root-account.cnf.example
Normal file
@ -0,0 +1,3 @@
|
||||
[client]
|
||||
user = root
|
||||
password = 123456
|
1
config/nginx/conf.d/.gitignore
vendored
1
config/nginx/conf.d/.gitignore
vendored
@ -1 +1,2 @@
|
||||
*.conf
|
||||
*.conf.disable
|
30
config/nginx/conf.d/gzip.conf.example
Normal file
30
config/nginx/conf.d/gzip.conf.example
Normal file
@ -0,0 +1,30 @@
|
||||
gzip on;
|
||||
gzip_disable "msie6";
|
||||
gzip_comp_level 5;
|
||||
gzip_min_length 256;
|
||||
gzip_proxied any;
|
||||
gzip_vary on;
|
||||
gzip_types
|
||||
application/atom+xml
|
||||
application/javascript
|
||||
application/json
|
||||
application/ld+json
|
||||
application/manifest+json
|
||||
application/rss+xml
|
||||
application/vnd.geo+json
|
||||
application/vnd.ms-fontobject
|
||||
application/x-font-ttf
|
||||
application/x-web-app-manifest+json
|
||||
application/xhtml+xml
|
||||
application/xml
|
||||
font/opentype
|
||||
image/bmp
|
||||
image/svg+xml
|
||||
image/x-icon
|
||||
text/cache-manifest
|
||||
text/css
|
||||
text/plain
|
||||
text/vnd.rim.location.xloc
|
||||
text/vtt
|
||||
text/x-component
|
||||
text/x-cross-domain-policy;
|
@ -1,55 +0,0 @@
|
||||
upstream fpm {
|
||||
server php-fpm:9000;
|
||||
}
|
||||
|
||||
upstream fpm7.1 {
|
||||
server php7.1-fpm:9000;
|
||||
}
|
||||
|
||||
map $http_host $root {
|
||||
loc.octobercms /usr/share/nginx/html/someproject;
|
||||
loc.wordpress /usr/share/nginx/html/someprojectwp;
|
||||
}
|
||||
|
||||
server {
|
||||
server_name loc.octobercms;
|
||||
listen 80;
|
||||
root $root;
|
||||
#include global/auth.conf;
|
||||
#@see https://vcs.wpstudio.ru/wpstudio/nginx-examples
|
||||
include includes.d/octobercms.conf;
|
||||
include includes.d/staticfiles.conf;
|
||||
location ~ ^/index.php {
|
||||
fastcgi_pass fpm;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
server_name loc.wordpress;
|
||||
listen 80;
|
||||
root $root;
|
||||
index index.html index.htm index.php;
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
|
||||
|
||||
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
|
||||
access_log off;
|
||||
}
|
||||
location ~ [^/]\.php(/|$) {
|
||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||
if (!-f $document_root$fastcgi_script_name) {
|
||||
return 404;
|
||||
}
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
|
||||
|
||||
fastcgi_pass fpm;
|
||||
fastcgi_index index.php;
|
||||
}
|
||||
}
|
65
config/nginx/conf.d/vhosts.conf.example
Normal file
65
config/nginx/conf.d/vhosts.conf.example
Normal file
@ -0,0 +1,65 @@
|
||||
#upstream php73 {
|
||||
# server php73:9000;
|
||||
#}
|
||||
|
||||
upstream php74 {
|
||||
server php74:9000;
|
||||
}
|
||||
|
||||
upstream php81 {
|
||||
server php81:9000;
|
||||
}
|
||||
|
||||
map $http_host $root {
|
||||
octobercms.local.wpstudio.ru /usr/share/nginx/html/someproject;
|
||||
wordpress.local.wpstudio.ru /usr/share/nginx/html/someprojectwp;
|
||||
}
|
||||
|
||||
# @see https://github.com/OFFLINE-GmbH/oc-responsive-images-plugin/#responsive-images
|
||||
map $http_accept $webp_suffix {
|
||||
default "";
|
||||
"~*webp" ".webp";
|
||||
}
|
||||
|
||||
resolver 127.0.0.11;
|
||||
|
||||
map $http_host $uploads_upstream {
|
||||
wordpress.local.wpstudio.ru "https://somewp.site";
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80 default;
|
||||
root $root;
|
||||
#include global/auth.conf;
|
||||
#@see https://vcs.wpstudio.ru/wpstudio/nginx-examples
|
||||
include includes.d/octobercms.conf;
|
||||
include includes.d/staticfiles.conf;
|
||||
client_max_body_size 300M;
|
||||
large_client_header_buffers 4 32k;
|
||||
location ~ ^/index.php {
|
||||
fastcgi_pass php81;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param SERVER_NAME $host;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name
|
||||
some-php74-site.local.wpstudio.ru
|
||||
;
|
||||
root $root;
|
||||
#include global/auth.conf;
|
||||
#@see https://vcs.wpstudio.ru/wpstudio/nginx-examples
|
||||
include includes.d/octobercms.conf;
|
||||
include includes.d/staticfiles.conf;
|
||||
client_max_body_size 300M;
|
||||
location ~ ^/index.php {
|
||||
fastcgi_pass php74;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param SERVER_NAME $host;
|
||||
}
|
||||
}
|
18
config/nginx/conf.d/z-directus.conf.example
Normal file
18
config/nginx/conf.d/z-directus.conf.example
Normal file
@ -0,0 +1,18 @@
|
||||
map $http_host $directus {
|
||||
directus-mi.local.wpstudio.ru directus-mi;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name
|
||||
directus-mi.local.wpstudio.ru
|
||||
;
|
||||
location / {
|
||||
resolver 127.0.0.11;
|
||||
proxy_pass http://$directus:8055;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
}
|
||||
}
|
24
config/nginx/conf.d/z-grav.conf.example
Normal file
24
config/nginx/conf.d/z-grav.conf.example
Normal file
@ -0,0 +1,24 @@
|
||||
server {
|
||||
server_name loc.wpstudio-new;
|
||||
listen 80;
|
||||
root $root;
|
||||
index index.html index.htm index.php;
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$query_string;
|
||||
}
|
||||
location ~ \.php$ {
|
||||
fastcgi_pass php74;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
}
|
||||
## Begin - Security
|
||||
# deny all direct access for these folders
|
||||
location ~* /(\.git|cache|bin|logs|backup|tests)/.*$ { return 403; }
|
||||
# deny running scripts inside core system folders
|
||||
location ~* /(system|vendor)/.*\.(txt|xml|md|html|yaml|yml|php|pl|py|cgi|twig|sh|bat|example)$ { return 403; }
|
||||
# deny running scripts inside user folder
|
||||
location ~* /user/.*\.(txt|md|yaml|yml|php|pl|py|cgi|twig|sh|bat)$ { return 403; }
|
||||
# deny access to specific files in the root folder
|
||||
location ~ /(LICENSE\.txt|composer\.lock|composer\.json|nginx\.conf|web\.config|htaccess\.txt|\.htaccess) { return 403; }
|
||||
## End - Security
|
||||
}
|
23
config/nginx/conf.d/z-nodejs.conf.example
Normal file
23
config/nginx/conf.d/z-nodejs.conf.example
Normal file
@ -0,0 +1,23 @@
|
||||
map $http_host $pm2 {
|
||||
someprojectone.build.local.wpstudio.ru pm2-someprojectone;
|
||||
someprojecttwo.build.local.wpstudio.ru pm2-someprojecttwo;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name
|
||||
someprojectone.build.local.wpstudio.ru
|
||||
someprojecttwo.build.local.wpstudio.ru
|
||||
;
|
||||
location / {
|
||||
resolver 127.0.0.11;
|
||||
proxy_pass http://$pm2:3000;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
proxy_buffer_size 16k;
|
||||
proxy_buffers 8 16k;
|
||||
proxy_busy_buffers_size 32k;
|
||||
}
|
||||
}
|
22
config/nginx/conf.d/z-octobercmswebp.conf.example
Normal file
22
config/nginx/conf.d/z-octobercmswebp.conf.example
Normal file
@ -0,0 +1,22 @@
|
||||
server {
|
||||
server_name
|
||||
octobercmswebp.ru.local.wpstudio.ru
|
||||
;
|
||||
listen 80;
|
||||
root $root;
|
||||
include includes.d/octobercms.conf;
|
||||
include includes.d/offline-webp.conf;
|
||||
include includes.d/staticfiles.conf;
|
||||
location = /index.php {
|
||||
fastcgi_pass php74;
|
||||
include fastcgi_params;
|
||||
fastcgi_read_timeout 3000;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
}
|
||||
location = /plugins/offline/responsiveimages/webp.php {
|
||||
fastcgi_pass php74;
|
||||
include fastcgi_params;
|
||||
fastcgi_read_timeout 3000;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
}
|
||||
}
|
14
config/nginx/conf.d/z-pma.conf.example
Normal file
14
config/nginx/conf.d/z-pma.conf.example
Normal file
@ -0,0 +1,14 @@
|
||||
server {
|
||||
server_name pma.e2e.10ballov.ru;
|
||||
listen 80;
|
||||
include includes.d/auth.conf;
|
||||
client_max_body_size 300M;
|
||||
location / {
|
||||
#resolver 127.0.0.11;
|
||||
proxy_pass http://pma;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
proxy_cache_bypass $http_upgrade;
|
||||
}
|
||||
}
|
39
config/nginx/conf.d/z-python.conf.example
Normal file
39
config/nginx/conf.d/z-python.conf.example
Normal file
@ -0,0 +1,39 @@
|
||||
map $http_host $python_upstream {
|
||||
someproject.local.wpstudio.ru http://python-someproject:8000;
|
||||
}
|
||||
|
||||
map $http_host $python_root {
|
||||
someproject.local.wpstudio.ru /usr/share/nginx/python/someproject;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name
|
||||
someproject.local.wpstudio.ru
|
||||
;
|
||||
|
||||
location / {
|
||||
resolver 127.0.0.11;
|
||||
proxy_pass $python_upstream;
|
||||
proxy_set_header Upgrade $http_upgrade;
|
||||
proxy_set_header Connection 'upgrade';
|
||||
proxy_set_header Host $host;
|
||||
}
|
||||
|
||||
root $python_root;
|
||||
|
||||
location @media_proxy {
|
||||
proxy_pass $uploads_upstream;
|
||||
proxy_ssl_server_name on;
|
||||
}
|
||||
|
||||
location ~ /media {
|
||||
root $python_root;
|
||||
try_files $uri @media_proxy;
|
||||
expires max;
|
||||
}
|
||||
|
||||
location ~ /static {
|
||||
expires max;
|
||||
}
|
||||
}
|
19
config/nginx/conf.d/z-s3.conf.example
Normal file
19
config/nginx/conf.d/z-s3.conf.example
Normal file
@ -0,0 +1,19 @@
|
||||
server {
|
||||
server_name s3.local;
|
||||
ignore_invalid_headers off;
|
||||
client_max_body_size 0;
|
||||
proxy_buffering off;
|
||||
location / {
|
||||
proxy_pass http://minio:9000;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_connect_timeout 300;
|
||||
# Default is HTTP/1, keepalive is only enabled in HTTP/1.1
|
||||
proxy_http_version 1.1;
|
||||
proxy_set_header Connection "";
|
||||
chunked_transfer_encoding off;
|
||||
}
|
||||
|
||||
listen 80;
|
||||
}
|
65
config/nginx/conf.d/z-wordpress.conf.example
Normal file
65
config/nginx/conf.d/z-wordpress.conf.example
Normal file
@ -0,0 +1,65 @@
|
||||
server {
|
||||
server_name
|
||||
wp-with-file-proxy.local.wpstudio.ru
|
||||
;
|
||||
listen 80;
|
||||
root $root;
|
||||
index index.html index.htm index.php;
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
|
||||
location ~* ^/wp-content/uploads/.*$ {
|
||||
expires max;
|
||||
proxy_pass $uploads_upstream;
|
||||
}
|
||||
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
|
||||
access_log off;
|
||||
}
|
||||
location ~ [^/]\.php(/|$) {
|
||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||
if (!-f $document_root$fastcgi_script_name) {
|
||||
return 404;
|
||||
}
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
|
||||
fastcgi_param SERVER_NAME $host;
|
||||
|
||||
fastcgi_pass php74;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_read_timeout 3000;
|
||||
}
|
||||
}
|
||||
|
||||
server {
|
||||
server_name
|
||||
wp.local.wpstudio.ru
|
||||
;
|
||||
listen 80;
|
||||
root $root;
|
||||
index index.html index.htm index.php;
|
||||
location / {
|
||||
try_files $uri $uri/ /index.php?$args;
|
||||
}
|
||||
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
|
||||
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
|
||||
access_log off;
|
||||
}
|
||||
location ~ [^/]\.php(/|$) {
|
||||
fastcgi_split_path_info ^(.+?\.php)(/.*)$;
|
||||
if (!-f $document_root$fastcgi_script_name) {
|
||||
return 404;
|
||||
}
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
|
||||
fastcgi_param SERVER_NAME $host;
|
||||
|
||||
fastcgi_pass php74;
|
||||
fastcgi_index index.php;
|
||||
fastcgi_read_timeout 3000;
|
||||
}
|
||||
}
|
41
config/nginx/conf.d/z-yii.conf.example
Normal file
41
config/nginx/conf.d/z-yii.conf.example
Normal file
@ -0,0 +1,41 @@
|
||||
server {
|
||||
server_name
|
||||
yii.local.slave.dimti.ru
|
||||
backend.yii.local.slave.dimti.ru
|
||||
;
|
||||
root $root;
|
||||
set $yii_bootstrap "index.php";
|
||||
charset utf-8;
|
||||
location / {
|
||||
index index.html $yii_bootstrap;
|
||||
try_files $uri $uri/ /$yii_bootstrap?$args;
|
||||
}
|
||||
location ~ ^/(protected|framework|themes/\w+/views) {
|
||||
deny all;
|
||||
}
|
||||
# отключаем обработку запросов фреймворком к несуществующим статичным файлам
|
||||
location ~ \.(js|css|png|jpg|gif|swf|ico|pdf|mov|fla|zip|rar)$ {
|
||||
try_files $uri =404;
|
||||
}
|
||||
# передаем PHP-скрипт серверу FastCGI, прослушивающему адрес 127.0.0.1:9000
|
||||
location ~ \.php {
|
||||
fastcgi_split_path_info ^(.+\.php)(.*)$;
|
||||
# позволяем yii перехватывать запросы к несуществующим PHP-файлам
|
||||
set $fsn /$yii_bootstrap;
|
||||
if (-f $document_root$fastcgi_script_name){
|
||||
set $fsn $fastcgi_script_name;
|
||||
}
|
||||
fastcgi_pass php74;
|
||||
include fastcgi_params;
|
||||
fastcgi_param SCRIPT_FILENAME $document_root$fsn;
|
||||
# PATH_INFO и PATH_TRANSLATED могут быть опущены, но стандарт RFC 3875 определяет для CGI
|
||||
fastcgi_param PATH_INFO $fastcgi_path_info;
|
||||
fastcgi_param PATH_TRANSLATED $document_root$fsn;
|
||||
}
|
||||
# не позволять nginx отдавать файлы, начинающиеся с точки (.htaccess, .svn, .git и прочие)
|
||||
location ~ /\. {
|
||||
deny all;
|
||||
access_log off;
|
||||
log_not_found off;
|
||||
}
|
||||
}
|
5
config/nginx/includes.d/auth.conf
Normal file
5
config/nginx/includes.d/auth.conf
Normal file
@ -0,0 +1,5 @@
|
||||
set $auth_basic Restricted;
|
||||
auth_basic $auth_basic;
|
||||
auth_basic_user_file includes.d/auth.passwd;
|
||||
# Use openssl for generate basic password
|
||||
# echo "MYUSER:$(openssl passwd -apr1 PASSWORD)" > auth.passwd
|
14
config/nginx/includes.d/https.conf
Normal file
14
config/nginx/includes.d/https.conf
Normal file
@ -0,0 +1,14 @@
|
||||
error_page 419 = @https;
|
||||
set $is_https "0";
|
||||
if ( $scheme ~* "^https") {
|
||||
set $is_https "${is_https}1";
|
||||
}
|
||||
if ( $request_uri ~* "api/v") {
|
||||
set $is_https "${is_https}1";
|
||||
}
|
||||
if ( $is_https = "0" ) {
|
||||
return 419;
|
||||
}
|
||||
location @https {
|
||||
rewrite ^ https://$http_host$request_uri permanent;
|
||||
}
|
@ -1,48 +1,56 @@
|
||||
location / {
|
||||
rewrite ^/.*$ /index.php last;
|
||||
}
|
||||
location ~ ^/combine.*\.(css|js) {
|
||||
rewrite ^/.*$ /index.php last;
|
||||
expires max;
|
||||
}
|
||||
|
||||
location / {
|
||||
rewrite ^/.*$ /index.php last;
|
||||
}
|
||||
location ~ ^/combine.*\.(css|js) {
|
||||
rewrite ^/.*$ /index.php last;
|
||||
expires max;
|
||||
}
|
||||
# Whitelist
|
||||
## Let October handle if static file not exists
|
||||
location ~ ^/favicon\.ico { try_files $uri /index.php; }
|
||||
location ~ ^/sitemap\.xml { try_files $uri /index.php; }
|
||||
location ~ ^/robots\.txt { try_files $uri /index.php; }
|
||||
location ~ ^/humans\.txt { try_files $uri /index.php; }
|
||||
# Whitelist
|
||||
|
||||
## Let nginx return 404 if static file not exists
|
||||
location ~ ^/storage/app/uploads/public { try_files $uri /404; }
|
||||
location ~ ^/storage/app/media { try_files $uri /404; }
|
||||
location ~ ^/storage/app/yml { try_files $uri /404; }
|
||||
location ~ ^/files { try_files $uri /404; }
|
||||
location ~ ^/storage/app/.*\.xls { try_files $uri /404; }
|
||||
location ~ ^/storage/temp/public { try_files $uri /404; }
|
||||
## Let October handle if static file not exists
|
||||
|
||||
location ~ ^/modules/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/resources { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/behaviors/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/behaviors/.*/resources { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/widgets/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/widgets/.*/resources { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/formwidgets/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/formwidgets/.*/resources { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/reportwidgets/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/reportwidgets/.*/resources { try_files $uri /404; }
|
||||
location = /favicon.ico { try_files $uri /index.php; }
|
||||
location ~ ^/.*\.xml { try_files $uri /index.php; }
|
||||
location = /robots.txt { try_files $uri /index.php; }
|
||||
location = /humans.txt { try_files $uri /index.php; }
|
||||
|
||||
location ~ ^/plugins/.*/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/resources { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/behaviors/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/behaviors/.*/resources { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/reportwidgets/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/reportwidgets/.*/resources { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/formwidgets/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/formwidgets/.*/resources { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/widgets/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/widgets/.*/resources { try_files $uri /404; }
|
||||
## Let nginx return 404 if static file not exists
|
||||
|
||||
location ~ ^/themes/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/themes/.*/semantic { try_files $uri /404; }
|
||||
location ~ ^/themes/.*/resources { try_files $uri /404; }
|
||||
location /storage/app/uploads/public {
|
||||
# add proxy cors headers
|
||||
add_header Access-Control-Allow-Headers "*" always;
|
||||
add_header Access-Control-Allow-Methods "*" always;
|
||||
add_header Access-Control-Allow-Origin "*" always;
|
||||
try_files $uri /404;
|
||||
}
|
||||
|
||||
location /storage/app/media { try_files $uri /404; }
|
||||
location /storage/app/yml { try_files $uri /404; }
|
||||
location /storage/app/docx { try_files $uri /404; }
|
||||
location /storage/app/resized { try_files $uri /404; }
|
||||
location /storage/temp/public { try_files $uri /404; }
|
||||
|
||||
location ~ ^/modules/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/resources { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/behaviors/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/behaviors/.*/resources { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/widgets/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/widgets/.*/resources { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/formwidgets/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/formwidgets/.*/resources { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/reportwidgets/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/modules/.*/reportwidgets/.*/resources { try_files $uri /404; }
|
||||
|
||||
location ~ ^/plugins/.*/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/resources { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/behaviors/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/behaviors/.*/resources { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/reportwidgets/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/reportwidgets/.*/resources { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/formwidgets/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/formwidgets/.*/resources { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/widgets/.*/assets { try_files $uri /404; }
|
||||
location ~ ^/plugins/.*/.*/widgets/.*/resources { try_files $uri /404; }
|
||||
|
||||
location ~ ^/themes/.*/resources { try_files $uri /404; }
|
||||
|
8
config/nginx/includes.d/offline-webp.conf
Normal file
8
config/nginx/includes.d/offline-webp.conf
Normal file
@ -0,0 +1,8 @@
|
||||
location ~* \.(jpe?g|png)$ {
|
||||
# @see https://github.com/OFFLINE-GmbH/oc-responsive-images-plugin/#responsive-images
|
||||
add_header Vary Accept;
|
||||
try_files $uri$webp_suffix @router;
|
||||
}
|
||||
location @router {
|
||||
rewrite ^(.*)$ /plugins/offline/responsiveimages/webp.php?path=$uri;
|
||||
}
|
@ -1,5 +1,23 @@
|
||||
rewrite "^(.*)\.(\d{10})\.(css|js)$" $1.$3 break;
|
||||
location ~* \.(jpg|jpeg|gif|png|svg|ico)$ {
|
||||
#rewrite "^(.*)\.(\d{10})\.(css|js)$" $1.$3 break;
|
||||
location ~* \.(gif|svg|ico)$ {
|
||||
access_log off;
|
||||
expires max;
|
||||
log_not_found off;
|
||||
error_page 404 = /empty;
|
||||
}
|
||||
location ~* \.jpe?g$ {
|
||||
access_log off;
|
||||
expires max;
|
||||
log_not_found off;
|
||||
error_page 404 = /empty;
|
||||
}
|
||||
location ~* \.webp {
|
||||
access_log off;
|
||||
expires max;
|
||||
log_not_found off;
|
||||
error_page 404 = /empty;
|
||||
}
|
||||
location ~* \.png$ {
|
||||
access_log off;
|
||||
expires max;
|
||||
log_not_found off;
|
||||
@ -9,7 +27,8 @@ location = /empty {
|
||||
expires 0;
|
||||
empty_gif;
|
||||
}
|
||||
location ~* \.(eot|ttf|woff|pdf|css|js)$ {
|
||||
location ~* \.(eot|ttf|woff|woff2|otf|pdf|css|js|mp4)$ {
|
||||
try_files $uri /404;
|
||||
access_log off;
|
||||
expires max;
|
||||
}
|
||||
|
2
config/nginx/ssl.d/.gitignore
vendored
Normal file
2
config/nginx/ssl.d/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
1
config/redis/.gitignore
vendored
Normal file
1
config/redis/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
/redis-local.conf
|
17
config/redis/redis-local.conf.example
Normal file
17
config/redis/redis-local.conf.example
Normal file
@ -0,0 +1,17 @@
|
||||
|
||||
# most usefully options
|
||||
port 6379
|
||||
tcp-backlog 128
|
||||
protected-mode no
|
||||
stop-writes-on-bgsave-error no
|
||||
databases 4
|
||||
# dump is not create if save options is gone
|
||||
# save 3600 1
|
||||
# name suffix needed because then old file is loaded, but no updated if no save options presented
|
||||
dbfilename dump_250110.rdb
|
||||
dir ./
|
||||
always-show-logo no
|
||||
syslog-enabled yes
|
||||
pidfile /var/run/redis_6379.pid
|
||||
loglevel notice
|
||||
logfile ""
|
File diff suppressed because it is too large
Load Diff
1319
config/redis/redis.conf.origin
Normal file
1319
config/redis/redis.conf.origin
Normal file
File diff suppressed because it is too large
Load Diff
3
config/supervisor/.gitignore
vendored
Normal file
3
config/supervisor/.gitignore
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
*
|
||||
!*.example
|
||||
!.gitignore
|
9
config/supervisor/uvicorn.conf.example
Normal file
9
config/supervisor/uvicorn.conf.example
Normal file
@ -0,0 +1,9 @@
|
||||
[fcgi-program:uvicorn]
|
||||
process_name=uvicorn-tourtennis-%(process_num)d
|
||||
socket=tcp://localhost:8000
|
||||
command=/var/python/tourtennis/.venv/bin/uvicorn --fd 0 main:App
|
||||
autostart=true
|
||||
autorestart=true
|
||||
numprocs=1
|
||||
user=laradock
|
||||
redirect_stderr=true
|
15
create-symlinks.sh
Executable file
15
create-symlinks.sh
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/bash
|
||||
DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
|
||||
|
||||
BASH_SCRIPTS_DIR="${DIR}/bash"
|
||||
|
||||
BASH_SCRIPTS=(`ls $BASH_SCRIPTS_DIR`)
|
||||
|
||||
for FILENAME in "${BASH_SCRIPTS[@]}"; do
|
||||
BASH_SCRIPT_FILE_PATH="${BASH_SCRIPTS_DIR}/${FILENAME}"
|
||||
SYMLINK_PATH="${HOME}/${FILENAME}"
|
||||
|
||||
if [[ ! -f "${SYMLINK_PATH}" ]]; then
|
||||
ln -s "${BASH_SCRIPT_FILE_PATH}" "${SYMLINK_PATH}"
|
||||
fi
|
||||
done
|
6
dc-node
Executable file
6
dc-node
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
# N - nginx; P - php; R - redis; M - mariadb
|
||||
|
||||
ARGS=$@
|
||||
|
||||
bash -ic "dc -f docker-compose.yml -f docker-compose.nodejs.yml $ARGS"
|
6
dc-php
Executable file
6
dc-php
Executable file
@ -0,0 +1,6 @@
|
||||
#!/bin/bash
|
||||
# N - nginx; P - php; R - redis; M - mariadb
|
||||
|
||||
ARGS=$@
|
||||
|
||||
bash -ic "dc -f docker-compose.yml -f docker-compose.redis.yml -f docker-compose.mariadb.yml $ARGS"
|
123
docker-compose.base.yml
Executable file
123
docker-compose.base.yml
Executable file
@ -0,0 +1,123 @@
|
||||
services:
|
||||
nginx:
|
||||
image: nginx
|
||||
restart: always
|
||||
volumes:
|
||||
- ${PROJECTS_DIR}:/usr/share/nginx/html
|
||||
- ${PYTHON_PROJECTS_DIR}:/usr/share/nginx/python
|
||||
- ./config/nginx/conf.d:/etc/nginx/conf.d
|
||||
- ./config/nginx/includes.d:/etc/nginx/includes.d
|
||||
- ./config/nginx/ssl.d:/etc/nginx/ssl.d
|
||||
- ./log/nginx:/var/log/nginx
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
php:
|
||||
build:
|
||||
context: ./dockerfiles/php-fpm
|
||||
args:
|
||||
- CUSTOM_TZ=${CUSTOM_TZ}
|
||||
- CUSTOM_LOCALE=${CUSTOM_LOCALE}
|
||||
- PHP_OPT_MEMORY_LIMIT=${PHP_OPT_MEMORY_LIMIT}
|
||||
- PHP_OPT_POST_MAX_SIZE=${PHP_OPT_POST_MAX_SIZE}
|
||||
- PHP_OPT_UPLOAD_MAX_FILESIZE=${PHP_OPT_UPLOAD_MAX_FILESIZE}
|
||||
- PHP_OPT_MAX_EXECUTION_TIME=${PHP_OPT_MAX_EXECUTION_TIME}
|
||||
# Other args that might be used for customize in every separate container
|
||||
# - INSTALL_PEAR_MAIL=true
|
||||
# - INSTALL_LIBREOFFICE=true
|
||||
# - INSTALL_NUC_CERTS=true
|
||||
# - PHP_OPT_SHORT_OPEN_TAG=On
|
||||
restart: always
|
||||
volumes:
|
||||
- ${PROJECTS_DIR}:/usr/share/nginx/html
|
||||
- ./data/profiler:/tmp/profiler
|
||||
workspace:
|
||||
build:
|
||||
context: ./dockerfiles/workspace
|
||||
args:
|
||||
- CUSTOM_TZ=${CUSTOM_TZ}
|
||||
- CUSTOM_LOCALE=${CUSTOM_LOCALE}
|
||||
- CUSTOM_PUID=${WORKSPACE_PUID}
|
||||
- CUSTOM_PGID=${WORKSPACE_PGID}
|
||||
- INSTALL_YADM=${WORKSPACE_INSTALL_YADM}
|
||||
- INSTALL_FINE_UTILS=${WORKSPACE_INSTALL_FINE_UTILS}
|
||||
- INSTALL_SSH=${WORKSPACE_INSTALL_SSH}
|
||||
- PHP_OPT_MEMORY_LIMIT=${WORKSPACE_PHP_OPT_MEMORY_LIMIT}
|
||||
# Other args that might be used for customize in every separate container
|
||||
# - CUSTOM_COMPOSER_VERSION=1
|
||||
# - INSTALL_WP_CLI=true
|
||||
# - INSTALL_PEAR_MAIL=true
|
||||
# - INSTALL_NODE=true
|
||||
# - NODE_VERSION=v18.18.0
|
||||
# - INSTALL_PYTHON=true
|
||||
# - PYTHON_VERSION=3.12
|
||||
# - INSTALL_SUPERVISOR=false # Not ready
|
||||
# - INSTALL_LIBREOFFICE=true
|
||||
# - INSTALL_NUC_CERTS=true
|
||||
# - PHP_OPT_SHORT_OPEN_TAG=On
|
||||
restart: always
|
||||
volumes:
|
||||
- ${PROJECTS_DIR}:/var/www
|
||||
- ./data/profiler:/tmp/profiler
|
||||
- ./config/supervisor:/etc/supervisor/conf.d
|
||||
extra_hosts:
|
||||
- "dockerhost:${DOCKER_HOST_IP}"
|
||||
secrets:
|
||||
- user_ssh_key
|
||||
- user_known_hosts
|
||||
- composer_auth
|
||||
db:
|
||||
image: mariadb
|
||||
restart: always
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: 123456
|
||||
volumes:
|
||||
- database:/var/lib/mysql
|
||||
- ./hostfiles:/hostfiles
|
||||
- ./log/mariadb:/var/log/mariadb
|
||||
- ./config/mariadb:/etc/mysql/conf.d
|
||||
security_opt:
|
||||
- seccomp=unconfined
|
||||
pma:
|
||||
image: phpmyadmin/phpmyadmin
|
||||
restart: always
|
||||
environment:
|
||||
PMA_HOST: db
|
||||
PMA_USER: root
|
||||
PMA_PASSWORD: 123456
|
||||
inbucket:
|
||||
image: inbucket/inbucket
|
||||
restart: always
|
||||
expose:
|
||||
- 2500
|
||||
redis:
|
||||
image: redis
|
||||
restart: always
|
||||
command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
|
||||
volumes:
|
||||
- ./config/redis/redis.conf:/usr/local/etc/redis/redis.conf
|
||||
- ./config/redis/redis-local.conf:/usr/local/etc/redis/redis-local.conf
|
||||
elastic:
|
||||
build:
|
||||
context: ./dockerfiles/elastic
|
||||
restart: on-failure
|
||||
environment:
|
||||
- discovery.type=single-node
|
||||
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
|
||||
ulimits:
|
||||
memlock:
|
||||
soft: -1
|
||||
hard: -1
|
||||
expose:
|
||||
- "9200"
|
||||
- "9300"
|
||||
minio:
|
||||
image: minio/minio:RELEASE.2020-06-12T00-06-19Z
|
||||
restart: always
|
||||
command: server /minio
|
||||
pm2:
|
||||
build:
|
||||
context: ./dockerfiles/pm2
|
||||
restart: always
|
||||
expose:
|
||||
- 3000
|
42
docker-compose.directus.yml.example
Normal file
42
docker-compose.directus.yml.example
Normal file
@ -0,0 +1,42 @@
|
||||
services:
|
||||
directus-mi:
|
||||
image: directus/directus:11.1.0
|
||||
ports:
|
||||
- 8055:8055
|
||||
volumes:
|
||||
- ./data/directus/mi/uploads:/directus/uploads
|
||||
- ./data/directus/mi/extensions:/directus/extensions
|
||||
depends_on:
|
||||
- db
|
||||
- redis-mi
|
||||
environment:
|
||||
KEY: ""
|
||||
SECRET: ""
|
||||
|
||||
DB_CLIENT: "mysql"
|
||||
DB_HOST: "db"
|
||||
DB_PORT: "3306"
|
||||
DB_DATABASE: "directus"
|
||||
DB_USER: "directus"
|
||||
DB_PASSWORD: "directus"
|
||||
|
||||
CACHE_ENABLED: "true"
|
||||
CACHE_AUTO_PURGE: "true"
|
||||
CACHE_STORE: "redis"
|
||||
REDIS: "redis://redis-mi:6379"
|
||||
|
||||
CACHE_TTL: 1d
|
||||
|
||||
ADMIN_EMAIL: "info@wpstudio.ru"
|
||||
ADMIN_PASSWORD: ""
|
||||
|
||||
TELEMETRY: false
|
||||
ACCESS_TOKEN_TTL: 15m
|
||||
REFRESH_TOKEN_TTL: 7d
|
||||
LOG_LEVEL: debug
|
||||
FLOWS_EXEC_ALLOWED_MODULES: "array:@elastic/elasticsearch"
|
||||
WEBSOCKETS_ENABLED: true
|
||||
|
||||
# Make sure to set this in production
|
||||
# (see https://docs.directus.io/self-hosted/config-options#general)
|
||||
# PUBLIC_URL: "https://directus.example.com"
|
9
docker-compose.dnsmasq.yml.example
Executable file
9
docker-compose.dnsmasq.yml.example
Executable file
@ -0,0 +1,9 @@
|
||||
services:
|
||||
dnsmasq:
|
||||
restart: always
|
||||
build:
|
||||
context: ./dockerfiles/dnsmasq
|
||||
volumes:
|
||||
- ./config/dnsmasq/dnsmasq.conf:/etc/dnsmasq.conf
|
||||
cap_add:
|
||||
- NET_ADMIN # @see https://man7.org/linux/man-pages/man7/capabilities.7.html
|
10
docker-compose.e2e.yml.example
Executable file
10
docker-compose.e2e.yml.example
Executable file
@ -0,0 +1,10 @@
|
||||
services:
|
||||
browserless:
|
||||
image: browserless/chrome:latest
|
||||
environment:
|
||||
- HOST=0.0.0.0
|
||||
- PORT=3000
|
||||
container_name: "browserless"
|
||||
restart: always
|
||||
ports:
|
||||
- "3000:3000"
|
13
docker-compose.elastic.yml.example
Executable file
13
docker-compose.elastic.yml.example
Executable file
@ -0,0 +1,13 @@
|
||||
services:
|
||||
elastic:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: elastic
|
||||
restart: always
|
||||
build:
|
||||
dockerfile: elastic752.Dockerfile
|
||||
volumes:
|
||||
- elastic:/usr/share/elastic/data
|
||||
|
||||
volumes:
|
||||
elastic:
|
16
docker-compose.gui-postgres.yml.example
Executable file
16
docker-compose.gui-postgres.yml.example
Executable file
@ -0,0 +1,16 @@
|
||||
services:
|
||||
adminer:
|
||||
image: adminer
|
||||
restart: always
|
||||
ports:
|
||||
- 8081:8080
|
||||
pgadmin:
|
||||
image: dpage/pgadmin4
|
||||
restart: always
|
||||
environment:
|
||||
PGADMIN_DEFAULT_EMAIL: info@wpstudio.ru
|
||||
PGADMIN_DEFAULT_PASSWORD: postgres
|
||||
ports:
|
||||
- "83:80"
|
||||
volumes:
|
||||
- ./hostfiles/pgadmin:/var/lib/pgadmin
|
27
docker-compose.gui-redis.yml.example
Executable file
27
docker-compose.gui-redis.yml.example
Executable file
@ -0,0 +1,27 @@
|
||||
services:
|
||||
redis-ui:
|
||||
image: marian/rebrow
|
||||
restart: always
|
||||
ports:
|
||||
- "5001:5001"
|
||||
links:
|
||||
- redis-example:redis-example
|
||||
redis-stack:
|
||||
image: redis/redis-stack:latest
|
||||
restart: always
|
||||
ports:
|
||||
- "8001:8001"
|
||||
expose:
|
||||
- 6379
|
||||
redis-commander:
|
||||
container_name: redis-commander
|
||||
hostname: redis-commander
|
||||
image: ghcr.io/joeferner/redis-commander:latest
|
||||
restart: always
|
||||
environment:
|
||||
- REDIS_HOSTS=intai:redis-intai:6379
|
||||
ports:
|
||||
- "8081:8081"
|
||||
|
||||
volumes:
|
||||
elastic:
|
14
docker-compose.mariadb.yml.example
Executable file
14
docker-compose.mariadb.yml.example
Executable file
@ -0,0 +1,14 @@
|
||||
services:
|
||||
db:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: db
|
||||
pma:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: pma
|
||||
ports:
|
||||
- "81:80"
|
||||
|
||||
volumes:
|
||||
database:
|
13
docker-compose.minio.yml.example
Executable file
13
docker-compose.minio.yml.example
Executable file
@ -0,0 +1,13 @@
|
||||
services:
|
||||
minio:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: minio
|
||||
volumes:
|
||||
- minio:/minio
|
||||
environment:
|
||||
MINIO_ACCESS_KEY:
|
||||
MINIO_SECRET_KEY:
|
||||
|
||||
volumes:
|
||||
minio:
|
13
docker-compose.nodejs.yml.example
Executable file
13
docker-compose.nodejs.yml.example
Executable file
@ -0,0 +1,13 @@
|
||||
services:
|
||||
pm2-someprojectone:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: pm2
|
||||
volumes:
|
||||
- ${PROJECTS_DIR}/someprojectone/.output:/.output
|
||||
pm2-someprojecttwo:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: pm2
|
||||
volumes:
|
||||
- ${PROJECTS_DIR}/someprojecttwo/.output:/.output
|
27
docker-compose.postgres.yml.example
Executable file
27
docker-compose.postgres.yml.example
Executable file
@ -0,0 +1,27 @@
|
||||
services:
|
||||
dbpg:
|
||||
image: postgres
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_PASSWORD: postgres
|
||||
volumes:
|
||||
- databasepg:/var/lib/postgresql/data
|
||||
- ./hostfiles:/hostfiles
|
||||
ports:
|
||||
- "5432:5432"
|
||||
db-project:
|
||||
image: postgis/postgis:14-3.3
|
||||
environment:
|
||||
- POSTGRES_DB=project_db
|
||||
- POSTGRES_USER=project_db_user
|
||||
- POSTGRES_PASSWORD=project_db_password
|
||||
ports:
|
||||
- "5434:5432"
|
||||
healthcheck:
|
||||
test: [ "CMD-SHELL", "pg_isready" ]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
volumes:
|
||||
databasepg:
|
30
docker-compose.python.yml.example
Executable file
30
docker-compose.python.yml.example
Executable file
@ -0,0 +1,30 @@
|
||||
services:
|
||||
python-someproject:
|
||||
user: ${WORKSPACE_PUID}:${WORKSPACE_PGID}
|
||||
build:
|
||||
context: ${PYTHON_PROJECTS_DIR}/someproject
|
||||
args:
|
||||
- PUID=${WORKSPACE_PUID}
|
||||
- PGID=${WORKSPACE_PGID}
|
||||
- PYTHON_VERSION=3.9.20
|
||||
volumes:
|
||||
- ${PYTHON_PROJECTS_DIR}/someproject:/app
|
||||
command: bash --init-file /venv/bin/activate -c "
|
||||
python manage.py migrate
|
||||
&& python manage.py collectstatic
|
||||
&& uvicorn 'APP_NAME.asgi:application' --host 0.0.0.0
|
||||
"
|
||||
python-project:
|
||||
user: ${WORKSPACE_PUID}:${WORKSPACE_PGID}
|
||||
restart: always
|
||||
build:
|
||||
context: ${PYTHON_PROJECTS_DIR}/project
|
||||
volumes:
|
||||
- ${PYTHON_PROJECTS_DIR}/project:/code
|
||||
command: bash -c "
|
||||
cd src
|
||||
&& python manage.py compilemessages
|
||||
&& python manage.py collectstatic --clear --noinput
|
||||
&& python manage.py migrate
|
||||
&& uvicorn --reload app.asgi:application --host 0.0.0.0
|
||||
"
|
9
docker-compose.redis.yml.example
Executable file
9
docker-compose.redis.yml.example
Executable file
@ -0,0 +1,9 @@
|
||||
services:
|
||||
redis-someprojectone:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: redis
|
||||
redis-someprojecttwo:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: redis
|
16
docker-compose.sphinxsearch.yml.example
Executable file
16
docker-compose.sphinxsearch.yml.example
Executable file
@ -0,0 +1,16 @@
|
||||
services:
|
||||
sphinx:
|
||||
build: ./dockerfiles/sphinx
|
||||
restart: always
|
||||
depends_on:
|
||||
- db
|
||||
command: sh -c 'searchd -c /etc/sphinxsearch/sphinx.conf & sleep 10 && while true; do indexer --rotate --all; sleep 7200; done'
|
||||
volumes:
|
||||
- ./config/sphinx:/etc/sphinxsearch
|
||||
- ./log/sphinx:/var/log/sphinxsearch
|
||||
- sphinx:/var/lib/sphinx/data
|
||||
expose:
|
||||
- "9306"
|
||||
|
||||
volumes:
|
||||
sphinx:
|
@ -1,199 +1,75 @@
|
||||
version: "2"
|
||||
|
||||
services:
|
||||
web:
|
||||
image: nginx
|
||||
restart: always
|
||||
nginx:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: nginx
|
||||
networks:
|
||||
default:
|
||||
aliases:
|
||||
- loc.10ballov
|
||||
volumes:
|
||||
- ${PROJECTS_DIR}:/usr/share/nginx/html
|
||||
- ./config/nginx/conf.d:/etc/nginx/conf.d
|
||||
- ./config/nginx/includes.d:/etc/nginx/includes.d
|
||||
- ./log/nginx:/var/log/nginx
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
expose:
|
||||
- 80
|
||||
php-fpm:
|
||||
build:
|
||||
context: ./dockerfiles/php-fpm
|
||||
args:
|
||||
- INSTALL_XDEBUG=${INSTALL_XDEBUG}
|
||||
- INSTALL_REDIS=${INSTALL_REDIS}
|
||||
- INSTALL_PEAR_MAIL=${INSTALL_PEAR_MAIL}
|
||||
- INSTALL_ZIP=${INSTALL_ZIP}
|
||||
- INSTALL_BZ2=${INSTALL_BZ2}
|
||||
- INSTALL_INTL=${INSTALL_INTL}
|
||||
- PHP_OPT_SHORT_OPEN_TAG=${PHP_OPT_SHORT_OPEN_TAG}
|
||||
- PHP_OPT_MAX_EXECUTION_TIME=${PHP_OPT_MAX_EXECUTION_TIME}
|
||||
- PHP_OPT_MEMORY_LIMIT=${PHP_OPT_MEMORY_LIMIT}
|
||||
- PHP_OPT_UPLOAD_MAX_FILESIZE=${PHP_OPT_UPLOAD_MAX_FILESIZE}
|
||||
restart: always
|
||||
volumes:
|
||||
- ${PROJECTS_DIR}:/usr/share/nginx/html
|
||||
- ./tmp/php-fpm:/tmp/profiling
|
||||
expose:
|
||||
- 9000
|
||||
php7.1-fpm:
|
||||
build:
|
||||
context: dockerfiles/php7.1-fpm
|
||||
args:
|
||||
- INSTALL_XDEBUG=${INSTALL_XDEBUG}
|
||||
- INSTALL_REDIS=${INSTALL_REDIS}
|
||||
- INSTALL_PEAR_MAIL=${INSTALL_PEAR_MAIL}
|
||||
- INSTALL_ZIP=${INSTALL_ZIP}
|
||||
- INSTALL_BZ2=${INSTALL_BZ2}
|
||||
- INSTALL_INTL=${INSTALL_INTL}
|
||||
- PHP_OPT_SHORT_OPEN_TAG=${PHP_OPT_SHORT_OPEN_TAG}
|
||||
- PHP_OPT_MAX_EXECUTION_TIME=${PHP_OPT_MAX_EXECUTION_TIME}
|
||||
- PHP_OPT_MEMORY_LIMIT=${PHP_OPT_MEMORY_LIMIT}
|
||||
- PHP_OPT_UPLOAD_MAX_FILESIZE=${PHP_OPT_UPLOAD_MAX_FILESIZE}
|
||||
restart: always
|
||||
volumes:
|
||||
- ${PROJECTS_DIR}:/usr/share/nginx/html
|
||||
expose:
|
||||
- 9000
|
||||
workspace:
|
||||
build:
|
||||
context: ./dockerfiles/workspace
|
||||
args:
|
||||
- PHP_VERSION=${WORKSPACE_PHP_VERSION}
|
||||
- PUID=${WORKSPACE_PUID}
|
||||
- PGID=${WORKSPACE_PGID}
|
||||
- TZ=${WORKSPACE_TIMEZONE}
|
||||
- COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL}
|
||||
- COMPOSER_AUTH=${WORKSPACE_COMPOSER_AUTH}
|
||||
- COMPOSER_REPO_PACKAGIST=${WORKSPACE_COMPOSER_REPO_PACKAGIST}
|
||||
- INSTALL_WP_CLI=${WORKSPACE_INSTALL_WP_CLI}
|
||||
- INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG}
|
||||
- INSTALL_SSH=${WORKSPACE_INSTALL_SSH}
|
||||
- SSH_PASSPHRAZE=${WORKSPACE_SSH_PASSPHRAZE}
|
||||
- INSTALL_FSWATCH=${WORKSPACE_INSTALL_FSWATCH}
|
||||
- INSTALL_NODE=${WORKSPACE_INSTALL_NODE}
|
||||
- NODE_VERSION=${WORKSPACE_NODE_VERSION}
|
||||
- NPM_REGISTRY=${WORKSPACE_NPM_REGISTRY}
|
||||
- INSTALL_YARN=${WORKSPACE_INSTALL_YARN}
|
||||
- YARN_VERSION=${WORKSPACE_YARN_VERSION}
|
||||
- INSTALL_GULP=${WORKSPACE_INSTALL_GULP}
|
||||
- INSTALL_MYSQL_CLIENT=${WORKSPACE_INSTALL_MYSQL_CLIENT}
|
||||
- INSTALL_PING=${WORKSPACE_INSTALL_PING}
|
||||
- INSTALL_PYTHON=${WORKSPACE_INSTALL_PYTHON}
|
||||
restart: always
|
||||
volumes:
|
||||
- ${PROJECTS_DIR}:/var/www
|
||||
extra_hosts:
|
||||
- "dockerhost:${DOCKER_HOST_IP}"
|
||||
workspace_alex2911:
|
||||
build:
|
||||
context: ./dockerfiles/workspace
|
||||
args:
|
||||
- PHP_VERSION=${WORKSPACE_PHP_VERSION}
|
||||
- PUID=${WORKSPACE_PUID}
|
||||
- PGID=${WORKSPACE_PGID}
|
||||
- TZ=${WORKSPACE_TIMEZONE}
|
||||
- COMPOSER_GLOBAL_INSTALL=${WORKSPACE_COMPOSER_GLOBAL_INSTALL}
|
||||
- COMPOSER_AUTH=${WORKSPACE_COMPOSER_AUTH}
|
||||
- COMPOSER_REPO_PACKAGIST=${WORKSPACE_COMPOSER_REPO_PACKAGIST}
|
||||
- INSTALL_WP_CLI=${WORKSPACE_INSTALL_WP_CLI}
|
||||
- INSTALL_XDEBUG=${WORKSPACE_INSTALL_XDEBUG}
|
||||
- INSTALL_SSH=${WORKSPACE_INSTALL_SSH}
|
||||
- SSH_PASSPHRAZE=${WORKSPACE_SSH_PASSPHRAZE}
|
||||
- INSTALL_FSWATCH=${WORKSPACE_INSTALL_FSWATCH}
|
||||
- INSTALL_NODE=${WORKSPACE_INSTALL_NODE}
|
||||
- NODE_VERSION=${WORKSPACE_NODE_VERSION}
|
||||
- NPM_REGISTRY=${WORKSPACE_NPM_REGISTRY}
|
||||
- INSTALL_YARN=${WORKSPACE_INSTALL_YARN}
|
||||
- YARN_VERSION=${WORKSPACE_YARN_VERSION}
|
||||
- INSTALL_GULP=${WORKSPACE_INSTALL_GULP}
|
||||
- INSTALL_MYSQL_CLIENT=${WORKSPACE_INSTALL_MYSQL_CLIENT}
|
||||
- INSTALL_PING=${WORKSPACE_INSTALL_PING}
|
||||
- INSTALL_PYTHON=${WORKSPACE_INSTALL_PYTHON}
|
||||
restart: always
|
||||
volumes:
|
||||
- ${PROJECTS_DIR}:/var/www
|
||||
extra_hosts:
|
||||
- "dockerhost:${DOCKER_HOST_IP}"
|
||||
sphinx:
|
||||
build: ./dockerfiles/sphinx
|
||||
restart: always
|
||||
- someproject.local.wpstudio.ru
|
||||
depends_on:
|
||||
- db
|
||||
command: sh -c 'searchd -c /etc/sphinxsearch/sphinx.conf & sleep 10 && while true; do indexer --rotate --all; sleep 7200; done'
|
||||
volumes:
|
||||
- /home/dimti/docker-compose-projects/structure/config/sphinx:/etc/sphinxsearch
|
||||
- /home/dimti/docker-compose-projects/structure/data/sphinx:/var/lib/sphinx/data
|
||||
- /home/dimti/docker-compose-projects/structure/log/sphinx:/var/log/sphinxsearch
|
||||
expose:
|
||||
- "9306"
|
||||
db:
|
||||
image: mariadb
|
||||
restart: always
|
||||
environment:
|
||||
MYSQL_ROOT_PASSWORD: 123456
|
||||
volumes:
|
||||
- database:/var/lib/mysql
|
||||
- ./hostfiles:/hostfiles
|
||||
- php74
|
||||
- php81
|
||||
php74:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: php
|
||||
build:
|
||||
dockerfile: php74.Dockerfile
|
||||
php81:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: php
|
||||
build:
|
||||
dockerfile: php81.Dockerfile
|
||||
php82:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: php
|
||||
build:
|
||||
dockerfile: php82.Dockerfile
|
||||
php83:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: php
|
||||
build:
|
||||
dockerfile: php83.Dockerfile
|
||||
workspace74:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: workspace
|
||||
build:
|
||||
dockerfile: workspace74.Dockerfile
|
||||
workspace81:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: workspace
|
||||
build:
|
||||
dockerfile: workspace81.Dockerfile
|
||||
workspace82:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: workspace
|
||||
build:
|
||||
dockerfile: workspace82.Dockerfile
|
||||
workspace83:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: workspace
|
||||
build:
|
||||
dockerfile: workspace83.Dockerfile
|
||||
inbucket:
|
||||
extends:
|
||||
file: docker-compose.base.yml
|
||||
service: inbucket
|
||||
ports:
|
||||
- "3306:3306"
|
||||
phpmyadmin:
|
||||
image: phpmyadmin/phpmyadmin
|
||||
restart: always
|
||||
environment:
|
||||
PMA_HOST: db
|
||||
PMA_USER: root
|
||||
PMA_PASSWORD: 123456
|
||||
ports:
|
||||
- "81:80"
|
||||
dbpg:
|
||||
image: postgres
|
||||
restart: always
|
||||
environment:
|
||||
POSTGRES_PASSWORD: postgres
|
||||
volumes:
|
||||
- databasepg:/var/lib/postgresql/data
|
||||
- /data/hostfiles:/hostfiles
|
||||
adminer:
|
||||
image: adminer
|
||||
restart: always
|
||||
ports:
|
||||
- 8080:8080
|
||||
pgadmin:
|
||||
image: dpage/pgadmin4
|
||||
restart: always
|
||||
environment:
|
||||
PGADMIN_DEFAULT_EMAIL: info@wpstudio.ru
|
||||
PGADMIN_DEFAULT_PASSWORD: postgres
|
||||
ports:
|
||||
- "83:80"
|
||||
volumes:
|
||||
- /data/hostfiles/pgadmin:/var/lib/pgadmin
|
||||
redis:
|
||||
image: redis
|
||||
restart: always
|
||||
command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
|
||||
volumes:
|
||||
- ./config/redis/redis.conf:/usr/local/etc/redis/redis.conf
|
||||
elasticsearch:
|
||||
image: docker.elastic.co/elasticsearch/elasticsearch:7.5.2
|
||||
restart: always
|
||||
container_name: elasticsearch
|
||||
environment:
|
||||
- discovery.type=single-node
|
||||
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
|
||||
ulimits:
|
||||
memlock:
|
||||
soft: -1
|
||||
hard: -1
|
||||
mem_limit: 2g
|
||||
volumes:
|
||||
- esdata1:/usr/share/elasticsearch/data
|
||||
expose:
|
||||
- "9200"
|
||||
- "9300"
|
||||
volumes:
|
||||
database:
|
||||
esdata1:
|
||||
- "82:9000"
|
||||
|
||||
secrets:
|
||||
user_ssh_key:
|
||||
file: ~/.ssh/id_rsa
|
||||
user_known_hosts:
|
||||
file: ~/.ssh/known_hosts
|
||||
composer_auth:
|
||||
# If in your system installed Composer V1 use ~/.composer/auth.json
|
||||
file: ~/.config/composer/auth.json
|
||||
|
9
dockerfiles/db/Dockerfile
Normal file
9
dockerfiles/db/Dockerfile
Normal file
@ -0,0 +1,9 @@
|
||||
FROM mariadb
|
||||
|
||||
RUN apt update && apt install -y locales
|
||||
|
||||
RUN sed -i 's/# ru_RU.UTF-8/ru_RU.UTF-8/' /etc/locale.gen
|
||||
|
||||
RUN locale-gen
|
||||
|
||||
RUN echo "export LANG=ru_RU.UTF-8" > /root/.bashrc
|
9
dockerfiles/dnsmasq/Dockerfile
Normal file
9
dockerfiles/dnsmasq/Dockerfile
Normal file
@ -0,0 +1,9 @@
|
||||
FROM alpine:latest
|
||||
|
||||
# @see https://github.com/mcmar/docker-dnsmasq
|
||||
|
||||
RUN apk --no-cache add dnsmasq
|
||||
|
||||
EXPOSE 53/tcp 53/udp 67/udp
|
||||
|
||||
CMD ["dnsmasq", "-k"]
|
3
dockerfiles/elastic/elastic732.Dockerfile
Normal file
3
dockerfiles/elastic/elastic732.Dockerfile
Normal file
@ -0,0 +1,3 @@
|
||||
FROM docker.elastic.co/elasticsearch/elasticsearch:7.3.2
|
||||
|
||||
RUN elasticsearch-plugin install analysis-icu
|
7
dockerfiles/elastic/elastic752.Dockerfile
Normal file
7
dockerfiles/elastic/elastic752.Dockerfile
Normal file
@ -0,0 +1,7 @@
|
||||
FROM elasticsearch:7.5.2
|
||||
|
||||
COPY ./plugins /plugins
|
||||
|
||||
RUN elasticsearch-plugin install file:///plugins/analysis-icu-7.5.2.zip
|
||||
|
||||
RUN rm -rf /plugins
|
BIN
dockerfiles/elastic/plugins/analysis-icu-7.5.2.zip
Normal file
BIN
dockerfiles/elastic/plugins/analysis-icu-7.5.2.zip
Normal file
Binary file not shown.
@ -1,150 +0,0 @@
|
||||
FROM php:7.3-fpm
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libfreetype6-dev \
|
||||
libjpeg62-turbo-dev \
|
||||
libpng-dev \
|
||||
libwebp-dev \
|
||||
&& docker-php-ext-install -j$(nproc) iconv \
|
||||
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ --with-webp-dir=/usr/include/ \
|
||||
&& docker-php-ext-install -j$(nproc) gd \
|
||||
&& docker-php-ext-install mysqli \
|
||||
&& docker-php-ext-enable mysqli
|
||||
|
||||
RUN apt-get update && docker-php-ext-install pdo pdo_mysql && docker-php-ext-enable pdo pdo_mysql
|
||||
|
||||
###########################################################################
|
||||
# xDebug:
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_XDEBUG=false
|
||||
|
||||
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
|
||||
# Install the xdebug extension
|
||||
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
||||
pecl install xdebug-2.5.5; \
|
||||
else \
|
||||
pecl install xdebug; \
|
||||
fi && \
|
||||
docker-php-ext-enable xdebug && \
|
||||
sed -i 's/^zend_extension=/;zend_extension=/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
|
||||
;fi
|
||||
|
||||
# Copy xdebug configuration for remote debugging
|
||||
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
|
||||
|
||||
RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /usr/local/etc/php/conf.d/xdebug.ini && \
|
||||
sed -i "s/xdebug.remote_enable=0/xdebug.remote_enable=1/" /usr/local/etc/php/conf.d/xdebug.ini && \
|
||||
sed -i "s/xdebug.cli_color=0/xdebug.cli_color=1/" /usr/local/etc/php/conf.d/xdebug.ini
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Redis and igbinary:
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_REDIS=false
|
||||
|
||||
RUN if [ ${INSTALL_REDIS} = true ]; then \
|
||||
pecl install igbinary \
|
||||
&& pecl install -a redis \
|
||||
&& docker-php-ext-enable igbinary redis \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# Zip:
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_ZIP=false
|
||||
|
||||
RUN if [ ${INSTALL_ZIP} = true ]; then \
|
||||
apt update && apt install -y libzip-dev \
|
||||
&& docker-php-ext-install zip \
|
||||
&& docker-php-ext-enable zip \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# Pear Mail and Mail_Mime:
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_PEAR_MAIL=false
|
||||
|
||||
RUN if [ ${INSTALL_PEAR_MAIL} = true ]; then \
|
||||
pear install Mail && pear install Mail_Mime \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# BZ2 function:
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_BZ2=false
|
||||
|
||||
RUN if [ ${INSTALL_BZ2} = true ]; then \
|
||||
apt update && apt install -y libbz2-ocaml-dev \
|
||||
&& docker-php-ext-install bz2 \
|
||||
&& docker-php-ext-enable bz2 \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# INTL function:
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_INTL=false
|
||||
|
||||
RUN if [ ${INSTALL_INTL} = true ]; then \
|
||||
apt update && apt install -y libicu-dev \
|
||||
&& docker-php-ext-install intl \
|
||||
&& docker-php-ext-enable intl \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# php.ini opts:
|
||||
###########################################################################
|
||||
|
||||
# https://github.com/php/php-src/blob/master/php.ini-development
|
||||
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
ARG PHP_OPT_SHORT_OPEN_TAG=Off
|
||||
|
||||
RUN sed -i "s/^short_open_tag = .*/short_open_tag = $PHP_OPT_SHORT_OPEN_TAG/g" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
ARG PHP_OPT_MAX_EXECUTION_TIME=30
|
||||
|
||||
RUN sed -i "s/^max_execution_time = .*/max_execution_time = $PHP_OPT_MAX_EXECUTION_TIME/g" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
ARG PHP_OPT_MEMORY_LIMIT=128M
|
||||
|
||||
RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
ARG PHP_OPT_UPLOAD_MAX_FILESIZE=2M
|
||||
|
||||
RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Prepend nginx 502 on showing errors:
|
||||
# @see https://stackoverflow.com/questions/55260221/laravel-php-7-3-nginx-502-upstream-prematurely-closed-fastcgi-stdout
|
||||
###########################################################################
|
||||
|
||||
RUN sed -i "s/^log_limit = .*/log_limit = 1024/g" "$PHP_INI_DIR/../php-fpm.d/docker.conf"
|
||||
|
||||
###########################################################################
|
||||
# BCMATH functions:
|
||||
###########################################################################
|
||||
|
||||
RUN docker-php-ext-install bcmath && docker-php-ext-enable bcmath
|
||||
|
||||
###########################################################################
|
||||
# GEOIP:
|
||||
###########################################################################
|
||||
|
||||
RUN apt update \
|
||||
&& apt install -y libgeoip-dev wget \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& pecl install geoip-1.1.1 \
|
||||
&& docker-php-ext-enable geoip
|
||||
|
||||
###########################################################################
|
||||
# PGSQL:
|
||||
###########################################################################
|
||||
|
||||
RUN apt-get update && apt install -y libpq-dev \
|
||||
&& docker-php-ext-install pdo_pgsql && docker-php-ext-enable pdo_pgsql
|
93
dockerfiles/php-fpm/php.base.Dockerfile
Normal file
93
dockerfiles/php-fpm/php.base.Dockerfile
Normal file
@ -0,0 +1,93 @@
|
||||
USER root
|
||||
|
||||
###########################################################################
|
||||
# Set custom timezone if needed
|
||||
###########################################################################
|
||||
|
||||
ARG CUSTOM_TZ=Etc/UTC
|
||||
|
||||
RUN if [ ${CUSTOM_TZ} -ne $(cat /etc/timezone) ]; then \
|
||||
ln -snf /usr/share/zoneinfo/$CUSTOM_TZ /etc/localtime && \
|
||||
echo $CUSTOM_TZ > /etc/timezone \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# Set additional locale if needed:
|
||||
###########################################################################
|
||||
|
||||
ARG CUSTOM_LOCALE=en_US.UTF-8
|
||||
|
||||
RUN if [ ${CUSTOM_LOCALE} -ne 'en_US.UTF-8' ]; then \
|
||||
locale-gen ${CUSTOM_LOCALE} \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# Pear Mail and Mail_Mime:
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
ARG INSTALL_PEAR_MAIL=false
|
||||
|
||||
RUN if [ ${INSTALL_PEAR_MAIL} = true ]; then \
|
||||
pear install Mail && pear install Mail_Mime \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# Libreoffice
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
ARG INSTALL_LIBREOFFICE=false
|
||||
|
||||
RUN if [ ${INSTALL_LIBREOFFICE} = true ]; then \
|
||||
apt update -qq && \
|
||||
apt-get install libreoffice-nogui -qq --no-install-recommends \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# НУЦ:
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
ARG INSTALL_NUC_CERTS=false
|
||||
|
||||
RUN if [ ${INSTALL_NUC_CERTS} = true ]; then \
|
||||
mkdir /usr/local/share/ca-certificates/extra && \
|
||||
cd /usr/local/share/ca-certificates/extra && \
|
||||
curl -O https://gu-st.ru/content/lending/russian_trusted_root_ca_pem.crt && \
|
||||
curl -O https://gu-st.ru/content/lending/russian_trusted_sub_ca_pem.crt && \
|
||||
update-ca-certificates \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# Tune opts:
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
ARG PHP_OPT_MEMORY_LIMIT=256M
|
||||
RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
ARG PHP_OPT_POST_MAX_SIZE=300M
|
||||
RUN sed -i "s/^post_max_size = .*/post_max_size = $PHP_OPT_POST_MAX_SIZE/g" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
ARG PHP_OPT_UPLOAD_MAX_FILESIZE=100M
|
||||
RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
ARG PHP_OPT_MAX_EXECUTION_TIME=600
|
||||
RUN sed -i "s/^max_execution_time = .*/max_execution_time = $PHP_OPT_MAX_EXECUTION_TIME/g" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
ARG PHP_OPT_SHORT_OPEN_TAG=Off
|
||||
RUN sed -i "s/^short_open_tag = .*/short_open_tag = $PHP_OPT_SHORT_OPEN_TAG/g" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
###########################################################################
|
||||
# Cleanup
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
# Clean up
|
||||
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
7
dockerfiles/php-fpm/php74.Dockerfile
Normal file
7
dockerfiles/php-fpm/php74.Dockerfile
Normal file
@ -0,0 +1,7 @@
|
||||
# syntax = edrevo/dockerfile-plus
|
||||
FROM dimti/php:7.4
|
||||
|
||||
ARG PHP_VERSION=7.4
|
||||
ENV PHP_VERSION ${PHP_VERSION}
|
||||
|
||||
INCLUDE+ ./php.base.Dockerfile
|
7
dockerfiles/php-fpm/php81.Dockerfile
Normal file
7
dockerfiles/php-fpm/php81.Dockerfile
Normal file
@ -0,0 +1,7 @@
|
||||
# syntax = edrevo/dockerfile-plus
|
||||
FROM dimti/php:8.1
|
||||
|
||||
ARG PHP_VERSION=8.1
|
||||
ENV PHP_VERSION ${PHP_VERSION}
|
||||
|
||||
INCLUDE+ ./php.base.Dockerfile
|
7
dockerfiles/php-fpm/php82.Dockerfile
Normal file
7
dockerfiles/php-fpm/php82.Dockerfile
Normal file
@ -0,0 +1,7 @@
|
||||
# syntax = edrevo/dockerfile-plus
|
||||
FROM dimti/php:8.2
|
||||
|
||||
ARG PHP_VERSION=8.2
|
||||
ENV PHP_VERSION ${PHP_VERSION}
|
||||
|
||||
INCLUDE+ ./php.base.Dockerfile
|
7
dockerfiles/php-fpm/php83.Dockerfile
Normal file
7
dockerfiles/php-fpm/php83.Dockerfile
Normal file
@ -0,0 +1,7 @@
|
||||
# syntax = edrevo/dockerfile-plus
|
||||
FROM dimti/php:8.3
|
||||
|
||||
ARG PHP_VERSION=8.3
|
||||
ENV PHP_VERSION ${PHP_VERSION}
|
||||
|
||||
INCLUDE+ ./php.base.Dockerfile
|
@ -1,101 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
# NOTE: At the moment, this has only been confirmed to work with PHP 7
|
||||
|
||||
|
||||
# Grab full name of php-fpm container
|
||||
PHP_FPM_CONTAINER=$(docker ps | grep php-fpm | awk '{print $1}')
|
||||
|
||||
|
||||
# Grab OS type
|
||||
if [[ "$(uname)" == "Darwin" ]]; then
|
||||
OS_TYPE="OSX"
|
||||
else
|
||||
OS_TYPE=$(expr substr $(uname -s) 1 5)
|
||||
fi
|
||||
|
||||
|
||||
xdebug_status ()
|
||||
{
|
||||
echo 'xDebug status'
|
||||
|
||||
# If running on Windows, need to prepend with winpty :(
|
||||
if [[ $OS_TYPE == "MINGW" ]]; then
|
||||
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||
|
||||
else
|
||||
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
xdebug_start ()
|
||||
{
|
||||
echo 'Start xDebug'
|
||||
|
||||
# And uncomment line with xdebug extension, thus enabling it
|
||||
ON_CMD="sed -i 's/^;zend_extension=/zend_extension=/g' \
|
||||
/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini"
|
||||
|
||||
|
||||
# If running on Windows, need to prepend with winpty :(
|
||||
if [[ $OS_TYPE == "MINGW" ]]; then
|
||||
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}"
|
||||
docker restart $PHP_FPM_CONTAINER
|
||||
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||
|
||||
else
|
||||
docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}"
|
||||
docker restart $PHP_FPM_CONTAINER
|
||||
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
xdebug_stop ()
|
||||
{
|
||||
echo 'Stop xDebug'
|
||||
|
||||
# Comment out xdebug extension line
|
||||
OFF_CMD="sed -i 's/^zend_extension=/;zend_extension=/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini"
|
||||
|
||||
|
||||
# If running on Windows, need to prepend with winpty :(
|
||||
if [[ $OS_TYPE == "MINGW" ]]; then
|
||||
# This is the equivalent of:
|
||||
# winpty docker exec -it laradock_php-fpm_1 bash -c 'bla bla bla'
|
||||
# Thanks to @michaelarnauts at https://github.com/docker/compose/issues/593
|
||||
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}"
|
||||
docker restart $PHP_FPM_CONTAINER
|
||||
#docker-compose restart php-fpm
|
||||
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||
|
||||
else
|
||||
docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}"
|
||||
# docker-compose restart php-fpm
|
||||
docker restart $PHP_FPM_CONTAINER
|
||||
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
case $@ in
|
||||
stop|STOP)
|
||||
xdebug_stop
|
||||
;;
|
||||
start|START)
|
||||
xdebug_start
|
||||
;;
|
||||
status|STATUS)
|
||||
xdebug_status
|
||||
;;
|
||||
*)
|
||||
echo "xDebug [Stop | Start | Status] in the ${PHP_FPM_CONTAINER} container."
|
||||
echo "xDebug must have already been installed."
|
||||
echo "Usage:"
|
||||
echo " .php-fpm/xdebug stop|start|status"
|
||||
|
||||
esac
|
||||
|
||||
exit 1
|
@ -1,126 +0,0 @@
|
||||
FROM php:7.1-fpm
|
||||
RUN apt-get update && apt-get install -y \
|
||||
libfreetype6-dev \
|
||||
libjpeg62-turbo-dev \
|
||||
libpng-dev \
|
||||
&& docker-php-ext-install -j$(nproc) iconv \
|
||||
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
|
||||
&& docker-php-ext-install -j$(nproc) gd \
|
||||
&& docker-php-ext-install mysqli \
|
||||
&& docker-php-ext-enable mysqli
|
||||
|
||||
RUN apt-get update && docker-php-ext-install pdo pdo_mysql && docker-php-ext-enable pdo pdo_mysql
|
||||
|
||||
###########################################################################
|
||||
# xDebug:
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_XDEBUG=false
|
||||
|
||||
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
|
||||
# Install the xdebug extension
|
||||
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
||||
pecl install xdebug-2.5.5; \
|
||||
else \
|
||||
pecl install xdebug; \
|
||||
fi && \
|
||||
docker-php-ext-enable xdebug && \
|
||||
sed -i 's/^zend_extension=/;zend_extension=/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini \
|
||||
;fi
|
||||
|
||||
# Copy xdebug configuration for remote debugging
|
||||
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
|
||||
|
||||
RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /usr/local/etc/php/conf.d/xdebug.ini && \
|
||||
sed -i "s/xdebug.remote_enable=0/xdebug.remote_enable=1/" /usr/local/etc/php/conf.d/xdebug.ini && \
|
||||
sed -i "s/xdebug.cli_color=0/xdebug.cli_color=1/" /usr/local/etc/php/conf.d/xdebug.ini
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Redis and igbinary:
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_REDIS=false
|
||||
|
||||
RUN if [ ${INSTALL_REDIS} = true ]; then \
|
||||
pecl install igbinary \
|
||||
&& pecl install -a redis \
|
||||
&& docker-php-ext-enable igbinary redis \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# Zip:
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_ZIP=false
|
||||
|
||||
RUN if [ ${INSTALL_ZIP} = true ]; then \
|
||||
apt update && apt install -y libzip-dev \
|
||||
&& docker-php-ext-install zip \
|
||||
&& docker-php-ext-enable zip \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# Pear Mail and Mail_Mime:
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_PEAR_MAIL=false
|
||||
|
||||
RUN if [ ${INSTALL_PEAR_MAIL} = true ]; then \
|
||||
pear install Mail && pear install Mail_Mime \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# BZ2 function:
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_BZ2=false
|
||||
|
||||
RUN if [ ${INSTALL_BZ2} = true ]; then \
|
||||
apt update && apt install -y libbz2-ocaml-dev \
|
||||
&& docker-php-ext-install bz2 \
|
||||
&& docker-php-ext-enable bz2 \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# INTL function:
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_INTL=false
|
||||
|
||||
RUN if [ ${INSTALL_INTL} = true ]; then \
|
||||
apt update && apt install -y libicu-dev \
|
||||
&& docker-php-ext-install intl \
|
||||
&& docker-php-ext-enable intl \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# php.ini opts:
|
||||
###########################################################################
|
||||
|
||||
# https://github.com/php/php-src/blob/master/php.ini-development
|
||||
RUN mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
ARG PHP_OPT_SHORT_OPEN_TAG=Off
|
||||
|
||||
RUN sed -i "s/^short_open_tag = .*/short_open_tag = $PHP_OPT_SHORT_OPEN_TAG/g" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
ARG PHP_OPT_MAX_EXECUTION_TIME=30
|
||||
|
||||
RUN sed -i "s/^max_execution_time = .*/max_execution_time = $PHP_OPT_MAX_EXECUTION_TIME/g" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
ARG PHP_OPT_MEMORY_LIMIT=128M
|
||||
|
||||
RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
ARG PHP_OPT_UPLOAD_MAX_FILESIZE=2M
|
||||
|
||||
RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini"
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Prepend nginx 502 on showing errors:
|
||||
# @see https://stackoverflow.com/questions/55260221/laravel-php-7-3-nginx-502-upstream-prematurely-closed-fastcgi-stdout
|
||||
###########################################################################
|
||||
|
||||
RUN sed -i "s/^log_limit = .*/log_limit = 1024/g" "$PHP_INI_DIR/../php-fpm.d/docker.conf"
|
@ -1,25 +0,0 @@
|
||||
; NOTE: The actual debug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini)
|
||||
|
||||
;xdebug.remote_host=dockerhost
|
||||
xdebug.remote_connect_back=1
|
||||
xdebug.remote_port=9000
|
||||
xdebug.idekey=PHPSTORM
|
||||
|
||||
xdebug.remote_autostart=0
|
||||
xdebug.remote_enable=0
|
||||
xdebug.cli_color=0
|
||||
xdebug.profiler_enable=1
|
||||
xdebug.profiler_enable_trigger=1
|
||||
xdebug.profiler_output_dir=/tmp
|
||||
|
||||
xdebug.remote_handler=dbgp
|
||||
xdebug.remote_mode=req
|
||||
|
||||
xdebug.var_display_max_children=-1
|
||||
xdebug.var_display_max_data=-1
|
||||
xdebug.var_display_max_depth=-1
|
||||
|
||||
xdebug.trace_enable_trigger=1
|
||||
xdebug.trace_output_dir=/tmp
|
||||
xdebug.trace_output_name="trace.%t"
|
||||
|
@ -1,101 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
# NOTE: At the moment, this has only been confirmed to work with PHP 7
|
||||
|
||||
|
||||
# Grab full name of php-fpm container
|
||||
PHP_FPM_CONTAINER=$(docker ps | grep php-fpm | awk '{print $1}')
|
||||
|
||||
|
||||
# Grab OS type
|
||||
if [[ "$(uname)" == "Darwin" ]]; then
|
||||
OS_TYPE="OSX"
|
||||
else
|
||||
OS_TYPE=$(expr substr $(uname -s) 1 5)
|
||||
fi
|
||||
|
||||
|
||||
xdebug_status ()
|
||||
{
|
||||
echo 'xDebug status'
|
||||
|
||||
# If running on Windows, need to prepend with winpty :(
|
||||
if [[ $OS_TYPE == "MINGW" ]]; then
|
||||
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||
|
||||
else
|
||||
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||
fi
|
||||
|
||||
}
|
||||
|
||||
|
||||
xdebug_start ()
|
||||
{
|
||||
echo 'Start xDebug'
|
||||
|
||||
# And uncomment line with xdebug extension, thus enabling it
|
||||
ON_CMD="sed -i 's/^;zend_extension=/zend_extension=/g' \
|
||||
/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini"
|
||||
|
||||
|
||||
# If running on Windows, need to prepend with winpty :(
|
||||
if [[ $OS_TYPE == "MINGW" ]]; then
|
||||
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}"
|
||||
docker restart $PHP_FPM_CONTAINER
|
||||
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||
|
||||
else
|
||||
docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}"
|
||||
docker restart $PHP_FPM_CONTAINER
|
||||
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
xdebug_stop ()
|
||||
{
|
||||
echo 'Stop xDebug'
|
||||
|
||||
# Comment out xdebug extension line
|
||||
OFF_CMD="sed -i 's/^zend_extension=/;zend_extension=/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini"
|
||||
|
||||
|
||||
# If running on Windows, need to prepend with winpty :(
|
||||
if [[ $OS_TYPE == "MINGW" ]]; then
|
||||
# This is the equivalent of:
|
||||
# winpty docker exec -it laradock_php-fpm_1 bash -c 'bla bla bla'
|
||||
# Thanks to @michaelarnauts at https://github.com/docker/compose/issues/593
|
||||
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}"
|
||||
docker restart $PHP_FPM_CONTAINER
|
||||
#docker-compose restart php-fpm
|
||||
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||
|
||||
else
|
||||
docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}"
|
||||
# docker-compose restart php-fpm
|
||||
docker restart $PHP_FPM_CONTAINER
|
||||
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||
fi
|
||||
}
|
||||
|
||||
|
||||
case $@ in
|
||||
stop|STOP)
|
||||
xdebug_stop
|
||||
;;
|
||||
start|START)
|
||||
xdebug_start
|
||||
;;
|
||||
status|STATUS)
|
||||
xdebug_status
|
||||
;;
|
||||
*)
|
||||
echo "xDebug [Stop | Start | Status] in the ${PHP_FPM_CONTAINER} container."
|
||||
echo "xDebug must have already been installed."
|
||||
echo "Usage:"
|
||||
echo " .php-fpm/xdebug stop|start|status"
|
||||
|
||||
esac
|
||||
|
||||
exit 1
|
5
dockerfiles/pm2/Dockerfile
Normal file
5
dockerfiles/pm2/Dockerfile
Normal file
@ -0,0 +1,5 @@
|
||||
FROM keymetrics/pm2:18-buster
|
||||
|
||||
COPY ./ecosystem.config.js /ecosystem.config.js
|
||||
|
||||
CMD ["pm2-runtime", "start", "ecosystem.config.js"]
|
11
dockerfiles/pm2/ecosystem.config.js
Normal file
11
dockerfiles/pm2/ecosystem.config.js
Normal file
@ -0,0 +1,11 @@
|
||||
module.exports = {
|
||||
apps: [
|
||||
{
|
||||
name: 'NuxtAppName',
|
||||
port: '3000',
|
||||
exec_mode: 'cluster',
|
||||
instances: '2',
|
||||
script: './.output/server/index.mjs',
|
||||
},
|
||||
],
|
||||
};
|
27
dockerfiles/python/Dockerfile.example
Normal file
27
dockerfiles/python/Dockerfile.example
Normal file
@ -0,0 +1,27 @@
|
||||
ARG PYTHON_VERSION
|
||||
FROM python:${PYTHON_VERSION}
|
||||
|
||||
ARG PUID=1000
|
||||
ARG PGID=1000
|
||||
|
||||
RUN groupadd -g ${PGID} pydock && \
|
||||
useradd -u ${PUID} -g pydock -m pydock && \
|
||||
usermod -p "*" pydock -s /bin/bash
|
||||
|
||||
RUN mkdir /venv && chown ${PUID}:${PGID} /venv
|
||||
|
||||
USER pydock
|
||||
|
||||
# Создаём виртуальное окружение ВНЕ /app
|
||||
RUN python -m venv /venv
|
||||
ENV PATH="/venv/bin:$PATH"
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY requirements.txt .
|
||||
|
||||
VOLUME /pip_cache
|
||||
|
||||
RUN . /venv/bin/activate && pip install --cache-dir=/pip_cache -r requirements.txt
|
||||
|
||||
EXPOSE 8000
|
2
dockerfiles/python/README.md
Normal file
2
dockerfiles/python/README.md
Normal file
@ -0,0 +1,2 @@
|
||||
Как вы уже поняли, это файл должен лежать в корневой директории проекта,
|
||||
так как нужно копировать от туда requirements.txt при сборке образа.
|
@ -1,447 +0,0 @@
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
# Image Setup
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
# To edit the 'workspace' base Image, visit its repository on Github
|
||||
# https://github.com/Laradock/workspace
|
||||
#
|
||||
# To change its version, see the available Tags on the Docker Hub:
|
||||
# https://hub.docker.com/r/laradock/workspace/tags/
|
||||
#
|
||||
# Note: Base Image name format {image-tag}-{php-version}
|
||||
#
|
||||
|
||||
ARG PHP_VERSION
|
||||
|
||||
# FROM laradock/workspace:2.2-${PHP_VERSION}
|
||||
FROM letsdockerize/laradock-workspace:2.4-${PHP_VERSION}
|
||||
|
||||
LABEL maintainer="Mahmoud Zalt <mahmoud@zalt.me>"
|
||||
|
||||
# Set Environment Variables
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
# Start as root
|
||||
USER root
|
||||
|
||||
###########################################################################
|
||||
# Laradock non-root user:
|
||||
###########################################################################
|
||||
|
||||
# Add a non-root user to prevent files being created with root permissions on host machine.
|
||||
ARG PUID=1000
|
||||
ENV PUID ${PUID}
|
||||
ARG PGID=1000
|
||||
ENV PGID ${PGID}
|
||||
|
||||
# always run apt update when start and after add new source list, then clean up at end.
|
||||
RUN set -xe; \
|
||||
apt-get update -yqq && \
|
||||
pecl channel-update pecl.php.net && \
|
||||
groupadd -g ${PGID} laradock && \
|
||||
useradd -u ${PUID} -g laradock -m laradock -G docker_env && \
|
||||
usermod -p "*" laradock -s /bin/bash && \
|
||||
apt-get install -yqq \
|
||||
apt-utils \
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
# Mandatory Software's Installation
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
# Mandatory Software's such as ("php-cli", "git", "vim", ....) are
|
||||
# installed on the base image 'laradock/workspace' image. If you want
|
||||
# to add more Software's or remove existing one, you need to edit the
|
||||
# base image (https://github.com/Laradock/workspace).
|
||||
#
|
||||
# next lines are here becase there is no auto build on dockerhub see https://github.com/laradock/laradock/pull/1903#issuecomment-463142846
|
||||
libzip-dev zip unzip \
|
||||
# Install the zip extension
|
||||
php${PHP_VERSION}-zip \
|
||||
# nasm
|
||||
nasm && \
|
||||
php -m | grep -q 'zip'
|
||||
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
# Optional Software's Installation
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
# Optional Software's will only be installed if you set them to `true`
|
||||
# in the `docker-compose.yml` before the build.
|
||||
# Example:
|
||||
# - WORKSPACE_INSTALL_NODE=false
|
||||
# - ...
|
||||
#
|
||||
|
||||
###########################################################################
|
||||
# Set Timezone
|
||||
###########################################################################
|
||||
|
||||
ARG TZ=Europe/Moscow
|
||||
ENV TZ ${TZ}
|
||||
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||
|
||||
###########################################################################
|
||||
# User Aliases
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
COPY ./aliases.sh /root/aliases.sh
|
||||
COPY ./aliases.sh /home/laradock/aliases.sh
|
||||
|
||||
RUN sed -i 's/\r//' /root/aliases.sh && \
|
||||
sed -i 's/\r//' /home/laradock/aliases.sh && \
|
||||
chown laradock:laradock /home/laradock/aliases.sh && \
|
||||
echo "" >> ~/.bashrc && \
|
||||
echo "# Load Custom Aliases" >> ~/.bashrc && \
|
||||
echo "source ~/aliases.sh" >> ~/.bashrc && \
|
||||
echo "" >> ~/.bashrc
|
||||
|
||||
USER laradock
|
||||
|
||||
RUN echo "" >> ~/.bashrc && \
|
||||
echo "# Load Custom Aliases" >> ~/.bashrc && \
|
||||
echo "source ~/aliases.sh" >> ~/.bashrc && \
|
||||
echo "" >> ~/.bashrc
|
||||
|
||||
###########################################################################
|
||||
# Composer:
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
# Add the composer.json
|
||||
COPY ./composer.json /home/laradock/.composer/composer.json
|
||||
|
||||
# Add the auth.json for magento 2 credentials
|
||||
COPY ./auth.json /home/laradock/.composer/auth.json
|
||||
|
||||
# Make sure that ~/.composer belongs to laradock
|
||||
RUN chown -R laradock:laradock /home/laradock/.composer
|
||||
|
||||
USER laradock
|
||||
|
||||
# Check if global install need to be ran
|
||||
ARG COMPOSER_GLOBAL_INSTALL=false
|
||||
ENV COMPOSER_GLOBAL_INSTALL ${COMPOSER_GLOBAL_INSTALL}
|
||||
|
||||
RUN if [ ${COMPOSER_GLOBAL_INSTALL} = true ]; then \
|
||||
# run the install
|
||||
composer global install \
|
||||
;fi
|
||||
|
||||
# Check if auth file is disabled
|
||||
ARG COMPOSER_AUTH=false
|
||||
ENV COMPOSER_AUTH ${COMPOSER_AUTH}
|
||||
|
||||
RUN if [ ${COMPOSER_AUTH} = false ]; then \
|
||||
# remove the file
|
||||
rm /home/laradock/.composer/auth.json \
|
||||
;fi
|
||||
|
||||
ARG COMPOSER_REPO_PACKAGIST
|
||||
ENV COMPOSER_REPO_PACKAGIST ${COMPOSER_REPO_PACKAGIST}
|
||||
|
||||
RUN if [ ${COMPOSER_REPO_PACKAGIST} ]; then \
|
||||
composer config -g repo.packagist composer ${COMPOSER_REPO_PACKAGIST} \
|
||||
;fi
|
||||
|
||||
# Export composer vendor path
|
||||
RUN echo "" >> ~/.bashrc && \
|
||||
echo 'export PATH="~/.composer/vendor/bin:$PATH"' >> ~/.bashrc
|
||||
|
||||
###########################################################################
|
||||
# Non-root user : PHPUnit path
|
||||
###########################################################################
|
||||
|
||||
# add ./vendor/bin to non-root user's bashrc (needed for phpunit)
|
||||
USER laradock
|
||||
|
||||
RUN echo "" >> ~/.bashrc && \
|
||||
echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc
|
||||
|
||||
###########################################################################
|
||||
# Crontab
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
COPY ./crontab /etc/cron.d
|
||||
|
||||
RUN chmod -R 644 /etc/cron.d
|
||||
|
||||
###########################################################################
|
||||
# WP CLI:
|
||||
###########################################################################
|
||||
|
||||
# The command line interface for WordPress
|
||||
|
||||
USER root
|
||||
|
||||
ARG INSTALL_WP_CLI=false
|
||||
|
||||
RUN if [ ${INSTALL_WP_CLI} = true ]; then \
|
||||
curl -fsSL -o /usr/local/bin/wp https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar | bash && \
|
||||
chmod +x /usr/local/bin/wp \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# xDebug:
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
ARG INSTALL_XDEBUG=false
|
||||
|
||||
RUN if [ ${INSTALL_XDEBUG} = true ]; then \
|
||||
# Load the xdebug extension only with phpunit commands
|
||||
apt-get install -y php${PHP_VERSION}-xdebug && \
|
||||
sed -i 's/^;//g' /etc/php/${PHP_VERSION}/cli/conf.d/20-xdebug.ini && \
|
||||
echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc \
|
||||
;fi
|
||||
|
||||
# ADD for REMOTE debugging
|
||||
COPY ./xdebug.ini /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini
|
||||
|
||||
RUN sed -i "s/xdebug.remote_autostart=0/xdebug.remote_autostart=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini && \
|
||||
sed -i "s/xdebug.remote_enable=0/xdebug.remote_enable=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini && \
|
||||
sed -i "s/xdebug.cli_color=0/xdebug.cli_color=1/" /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini
|
||||
|
||||
|
||||
###########################################################################
|
||||
# Additional PHP-extensions:
|
||||
###########################################################################
|
||||
|
||||
RUN pecl install igbinary \
|
||||
&& pecl install -a redis
|
||||
|
||||
###########################################################################
|
||||
# ssh:
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_SSH=false
|
||||
ENV INSTALL_SSH ${INSTALL_SSH}
|
||||
|
||||
ARG SSH_PASSPHRAZE=12345
|
||||
ENV SSH_PASSPHRAZE ${SSH_PASSPHRAZE}
|
||||
|
||||
RUN ssh-keygen -f /tmp/id_rsa -N ${SSH_PASSPHRAZE}
|
||||
|
||||
RUN if [ ${INSTALL_SSH} = true ]; then \
|
||||
rm -f /etc/service/sshd/down && \
|
||||
cat /tmp/id_rsa.pub >> /root/.ssh/authorized_keys \
|
||||
&& cat /tmp/id_rsa.pub >> /root/.ssh/id_rsa.pub \
|
||||
&& cat /tmp/id_rsa >> /root/.ssh/id_rsa \
|
||||
&& rm -f /tmp/id_rsa* \
|
||||
&& chmod 644 /root/.ssh/authorized_keys /root/.ssh/id_rsa.pub \
|
||||
&& chmod 400 /root/.ssh/id_rsa \
|
||||
&& cp -rf /root/.ssh /home/laradock \
|
||||
&& chown -R laradock:laradock /home/laradock/.ssh \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# fswatch
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_FSWATCH=false
|
||||
|
||||
RUN if [ ${INSTALL_FSWATCH} = true ]; then \
|
||||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 47FE03C1 \
|
||||
&& add-apt-repository -y ppa:hadret/fswatch \
|
||||
|| apt-get update -yqq \
|
||||
&& apt-get -y install fswatch \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# Node / NVM:
|
||||
###########################################################################
|
||||
|
||||
USER laradock
|
||||
|
||||
# Check if NVM needs to be installed
|
||||
ARG INSTALL_NODE=false
|
||||
ENV INSTALL_NODE ${INSTALL_NODE}
|
||||
ARG NODE_VERSION=node
|
||||
ENV NODE_VERSION ${NODE_VERSION}
|
||||
ARG INSTALL_NPM_GULP=false
|
||||
ARG INSTALL_NPM_BOWER=false
|
||||
ARG INSTALL_NPM_VUE_CLI=false
|
||||
ARG INSTALL_NPM_ANGULAR_CLI=false
|
||||
ARG NPM_REGISTRY
|
||||
ENV NPM_REGISTRY ${NPM_REGISTRY}
|
||||
ENV NVM_DIR /home/laradock/.nvm
|
||||
|
||||
RUN if [ ${INSTALL_NODE} = true ]; then \
|
||||
# Install nvm (A Node Version Manager)
|
||||
mkdir -p $NVM_DIR && \
|
||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash \
|
||||
&& . $NVM_DIR/nvm.sh \
|
||||
&& nvm install ${NODE_VERSION} \
|
||||
&& nvm use ${NODE_VERSION} \
|
||||
&& nvm alias ${NODE_VERSION} \
|
||||
&& if [ ${NPM_REGISTRY} ]; then \
|
||||
npm config set registry ${NPM_REGISTRY} \
|
||||
;fi \
|
||||
&& if [ ${INSTALL_NPM_GULP} = true ]; then \
|
||||
npm install -g gulp \
|
||||
;fi \
|
||||
&& if [ ${INSTALL_NPM_BOWER} = true ]; then \
|
||||
npm install -g bower \
|
||||
;fi \
|
||||
&& if [ ${INSTALL_NPM_VUE_CLI} = true ]; then \
|
||||
npm install -g @vue/cli \
|
||||
;fi \
|
||||
&& if [ ${INSTALL_NPM_ANGULAR_CLI} = true ]; then \
|
||||
npm install -g @angular/cli \
|
||||
;fi \
|
||||
&& ln -s `npm bin --global` /home/laradock/.node-bin \
|
||||
;fi
|
||||
|
||||
# Wouldn't execute when added to the RUN statement in the above block
|
||||
# Source NVM when loading bash since ~/.profile isn't loaded on non-login shell
|
||||
RUN if [ ${INSTALL_NODE} = true ]; then \
|
||||
echo "" >> ~/.bashrc && \
|
||||
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc && \
|
||||
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
|
||||
;fi
|
||||
|
||||
# Add NVM binaries to root's .bashrc
|
||||
USER root
|
||||
|
||||
RUN if [ ${INSTALL_NODE} = true ]; then \
|
||||
cp -R /home/laradock/.nvm /root/ && \
|
||||
chown -R root:root /root/.nvm && \
|
||||
echo "" >> ~/.bashrc && \
|
||||
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc && \
|
||||
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc \
|
||||
;fi
|
||||
|
||||
# Add PATH for node
|
||||
ENV PATH $PATH:/home/laradock/.node-bin
|
||||
|
||||
# Make it so the node modules can be executed with 'docker-compose exec'
|
||||
# We'll create symbolic links into '/usr/local/bin'.
|
||||
RUN if [ ${INSTALL_NODE} = true ]; then \
|
||||
find $NVM_DIR -type f -name node -exec ln -s {} /usr/local/bin/node \; && \
|
||||
NODE_MODS_DIR="$NVM_DIR/versions/node/$(node -v)/lib/node_modules" && \
|
||||
ln -s $NODE_MODS_DIR/bower/bin/bower /usr/local/bin/bower && \
|
||||
ln -s $NODE_MODS_DIR/gulp/bin/gulp.js /usr/local/bin/gulp && \
|
||||
ln -s $NODE_MODS_DIR/npm/bin/npm-cli.js /usr/local/bin/npm && \
|
||||
ln -s $NODE_MODS_DIR/npm/bin/npx-cli.js /usr/local/bin/npx && \
|
||||
ln -s $NODE_MODS_DIR/vue-cli/bin/vue /usr/local/bin/vue && \
|
||||
ln -s $NODE_MODS_DIR/vue-cli/bin/vue-init /usr/local/bin/vue-init && \
|
||||
ln -s $NODE_MODS_DIR/vue-cli/bin/vue-list /usr/local/bin/vue-list \
|
||||
;fi
|
||||
|
||||
RUN if [ ${NPM_REGISTRY} ]; then \
|
||||
. ~/.bashrc && npm config set registry ${NPM_REGISTRY} \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# YARN:
|
||||
###########################################################################
|
||||
|
||||
USER laradock
|
||||
|
||||
ARG INSTALL_YARN=false
|
||||
ARG YARN_VERSION=latest
|
||||
ENV YARN_VERSION ${YARN_VERSION}
|
||||
|
||||
RUN if [ ${INSTALL_YARN} = true ]; then \
|
||||
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" && \
|
||||
if [ ${YARN_VERSION} = "latest" ]; then \
|
||||
curl -o- -L https://yarnpkg.com/install.sh | bash; \
|
||||
else \
|
||||
curl -o- -L https://yarnpkg.com/install.sh | bash -s -- --version ${YARN_VERSION}; \
|
||||
fi && \
|
||||
echo "" >> ~/.bashrc && \
|
||||
echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc \
|
||||
;fi
|
||||
|
||||
# Add YARN binaries to root's .bashrc
|
||||
USER root
|
||||
|
||||
RUN if [ ${INSTALL_YARN} = true ]; then \
|
||||
echo "" >> ~/.bashrc && \
|
||||
echo 'export YARN_DIR="/home/laradock/.yarn"' >> ~/.bashrc && \
|
||||
echo 'export PATH="$YARN_DIR/bin:$PATH"' >> ~/.bashrc \
|
||||
;fi
|
||||
|
||||
# Add PATH for YARN
|
||||
ENV PATH $PATH:/home/laradock/.yarn/bin
|
||||
|
||||
###########################################################################
|
||||
# YARN:
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_GULP=false
|
||||
ENV INSTALL_GULP ${INSTALL_GULP}
|
||||
|
||||
USER root
|
||||
|
||||
RUN if [ ${INSTALL_GULP} = true ]; then \
|
||||
npm i -g gulp gulp-cli \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# MySQL Client:
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
ARG INSTALL_MYSQL_CLIENT=false
|
||||
|
||||
RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \
|
||||
apt-get update -yqq && \
|
||||
apt-get -y install mysql-client \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# ping:
|
||||
###########################################################################
|
||||
|
||||
USER root
|
||||
|
||||
ARG INSTALL_PING=false
|
||||
|
||||
RUN if [ ${INSTALL_PING} = true ]; then \
|
||||
apt-get update -yqq && \
|
||||
apt-get -y install inetutils-ping \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# PYTHON:
|
||||
###########################################################################
|
||||
|
||||
ARG INSTALL_PYTHON=false
|
||||
|
||||
RUN if [ ${INSTALL_PYTHON} = true ]; then \
|
||||
apt-get -y install python python-pip python-dev build-essential \
|
||||
&& python -m pip install --upgrade pip \
|
||||
&& python -m pip install --upgrade virtualenv \
|
||||
;fi
|
||||
|
||||
###########################################################################
|
||||
# Check PHP version:
|
||||
###########################################################################
|
||||
|
||||
RUN set -xe; php -v | head -n 1 | grep -q "PHP ${PHP_VERSION}."
|
||||
|
||||
#
|
||||
#--------------------------------------------------------------------------
|
||||
# Final Touch
|
||||
#--------------------------------------------------------------------------
|
||||
#
|
||||
|
||||
USER root
|
||||
|
||||
# Clean up
|
||||
RUN apt-get clean && \
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
|
||||
rm /var/log/lastlog /var/log/faillog
|
||||
|
||||
# Set default work directory
|
||||
WORKDIR /var/www
|
@ -1,3 +0,0 @@
|
||||
extension=aerospike.so
|
||||
aerospike.udf.lua_system_path=/usr/local/aerospike/lua
|
||||
aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua
|
@ -1,153 +0,0 @@
|
||||
#! /bin/bash
|
||||
|
||||
# Colors used for status updates
|
||||
ESC_SEQ="\x1b["
|
||||
COL_RESET=$ESC_SEQ"39;49;00m"
|
||||
COL_RED=$ESC_SEQ"31;01m"
|
||||
COL_GREEN=$ESC_SEQ"32;01m"
|
||||
COL_YELLOW=$ESC_SEQ"33;01m"
|
||||
COL_BLUE=$ESC_SEQ"34;01m"
|
||||
COL_MAGENTA=$ESC_SEQ"35;01m"
|
||||
COL_CYAN=$ESC_SEQ"36;01m"
|
||||
|
||||
# Detect which `ls` flavor is in use
|
||||
if ls --color > /dev/null 2>&1; then # GNU `ls`
|
||||
colorflag="--color"
|
||||
export LS_COLORS='no=00:fi=00:di=01;31:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
|
||||
else # macOS `ls`
|
||||
colorflag="-G"
|
||||
export LSCOLORS='BxBxhxDxfxhxhxhxhxcxcx'
|
||||
fi
|
||||
|
||||
# List all files colorized in long format
|
||||
#alias l="ls -lF ${colorflag}"
|
||||
### MEGA: I want l and la ti return hisdden files
|
||||
alias l="ls -laF ${colorflag}"
|
||||
|
||||
# List all files colorized in long format, including dot files
|
||||
alias la="ls -laF ${colorflag}"
|
||||
|
||||
# List only directories
|
||||
alias lsd="ls -lF ${colorflag} | grep --color=never '^d'"
|
||||
|
||||
# Always use color output for `ls`
|
||||
alias ls="command ls ${colorflag}"
|
||||
|
||||
# Commonly Used Aliases
|
||||
alias ..="cd .."
|
||||
alias ...="cd ../.."
|
||||
alias ....="cd ../../.."
|
||||
alias .....="cd ../../../.."
|
||||
alias ~="cd ~" # `cd` is probably faster to type though
|
||||
alias -- -="cd -"
|
||||
alias home="cd ~"
|
||||
|
||||
alias h="history"
|
||||
alias j="jobs"
|
||||
alias e='exit'
|
||||
alias c="clear"
|
||||
alias cla="clear && ls -la"
|
||||
alias cll="clear && ls -l"
|
||||
alias cls="clear && ls"
|
||||
alias code="cd /var/www"
|
||||
alias ea="vi ~/aliases.sh"
|
||||
|
||||
# Always enable colored `grep` output
|
||||
# Note: `GREP_OPTIONS="--color=auto"` is deprecated, hence the alias usage.
|
||||
alias grep='grep --color=auto'
|
||||
alias fgrep='fgrep --color=auto'
|
||||
alias egrep='egrep --color=auto'
|
||||
|
||||
alias art="php artisan"
|
||||
alias artisan="php artisan"
|
||||
alias cdump="composer dump-autoload -o"
|
||||
alias composer:dump="composer dump-autoload -o"
|
||||
alias db:reset="php artisan migrate:reset && php artisan migrate --seed"
|
||||
alias dusk="php artisan dusk"
|
||||
alias fresh="php artisan migrate:fresh"
|
||||
alias migrate="php artisan migrate"
|
||||
alias refresh="php artisan migrate:refresh"
|
||||
alias rollback="php artisan migrate:rollback"
|
||||
alias seed="php artisan db:seed"
|
||||
alias serve="php artisan serve --quiet &"
|
||||
|
||||
alias phpunit="./vendor/bin/phpunit"
|
||||
alias pu="phpunit"
|
||||
alias puf="phpunit --filter"
|
||||
alias pud='phpunit --debug'
|
||||
|
||||
alias cc='codecept'
|
||||
alias ccb='codecept build'
|
||||
alias ccr='codecept run'
|
||||
alias ccu='codecept run unit'
|
||||
alias ccf='codecept run functional'
|
||||
|
||||
alias g="gulp"
|
||||
alias npm-global="npm list -g --depth 0"
|
||||
alias ra="reload"
|
||||
alias reload="source ~/.aliases && echo \"$COL_GREEN ==> Aliases Reloaded... $COL_RESET \n \""
|
||||
alias run="npm run"
|
||||
alias tree="xtree"
|
||||
|
||||
# Xvfb
|
||||
alias xvfb="Xvfb -ac :0 -screen 0 1024x768x16 &"
|
||||
|
||||
# requires installation of 'https://www.npmjs.com/package/npms-cli'
|
||||
alias npms="npms search"
|
||||
# requires installation of 'https://www.npmjs.com/package/package-menu-cli'
|
||||
alias pm="package-menu"
|
||||
# requires installation of 'https://www.npmjs.com/package/pkg-version-cli'
|
||||
alias pv="package-version"
|
||||
# requires installation of 'https://github.com/sindresorhus/latest-version-cli'
|
||||
alias lv="latest-version"
|
||||
|
||||
# git aliases
|
||||
alias gaa="git add ."
|
||||
alias gd="git --no-pager diff"
|
||||
alias git-revert="git reset --hard && git clean -df"
|
||||
alias gs="git status"
|
||||
alias whoops="git reset --hard && git clean -df"
|
||||
alias glog="git log --oneline --decorate --graph"
|
||||
alias gloga="git log --oneline --decorate --graph --all"
|
||||
alias gsh="git show"
|
||||
alias grb="git rebase -i"
|
||||
alias gbr="git branch"
|
||||
alias gc="git commit"
|
||||
alias gck="git checkout"
|
||||
alias gull="git pull --rebase"
|
||||
alias gush="git push"
|
||||
|
||||
# Create a new directory and enter it
|
||||
function mkd() {
|
||||
mkdir -p "$@" && cd "$@"
|
||||
}
|
||||
|
||||
function md() {
|
||||
mkdir -p "$@" && cd "$@"
|
||||
}
|
||||
|
||||
function xtree {
|
||||
find ${1:-.} -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
|
||||
}
|
||||
|
||||
# `tre` is a shorthand for `tree` with hidden files and color enabled, ignoring
|
||||
# the `.git` directory, listing directories first. The output gets piped into
|
||||
# `less` with options to preserve color and line numbers, unless the output is
|
||||
# small enough for one screen.
|
||||
function tre() {
|
||||
tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@" | less -FRNX;
|
||||
}
|
||||
|
||||
# Determine size of a file or total size of a directory
|
||||
function fs() {
|
||||
if du -b /dev/null > /dev/null 2>&1; then
|
||||
local arg=-sbh;
|
||||
else
|
||||
local arg=-sh;
|
||||
fi
|
||||
if [[ -n "$@" ]]; then
|
||||
du $arg -- "$@";
|
||||
else
|
||||
du $arg .[^.]* ./*;
|
||||
fi;
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
{
|
||||
"http-basic": {
|
||||
"repo.magento.com": {
|
||||
"username": "",
|
||||
"password": ""
|
||||
}
|
||||
},
|
||||
"github-oauth": {
|
||||
"github.com": "e12b92ef777d9cfdd43c95a557dce7ffe4ad4407"
|
||||
}
|
||||
}
|
@ -1,5 +0,0 @@
|
||||
{
|
||||
"require": {
|
||||
|
||||
}
|
||||
}
|
1
dockerfiles/workspace/crontab-examples/laradock
Normal file
1
dockerfiles/workspace/crontab-examples/laradock
Normal file
@ -0,0 +1 @@
|
||||
#* * * * * laradock /usr/bin/php /var/www/yourproject/artisan schedule:run >> /dev/null 2>&1
|
2
dockerfiles/workspace/crontab/.gitignore
vendored
Normal file
2
dockerfiles/workspace/crontab/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
@ -1 +0,0 @@
|
||||
* * * * * laradock /usr/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user