Compare commits

...

41 Commits

Author SHA1 Message Date
4c410fa89f + python projects nginx example config and postgis and additional python server docker examples 2025-06-24 13:53:12 +03:00
92cefd6fcd + use ssh key from host machine in workspace container 2025-06-11 20:47:53 +03:00
94fe970cd3 + added ARG definition for FINE UTILS
+ added wget, unzip, curl, grep, dbview to FINE UTILS
2025-06-11 19:49:14 +03:00
537b5ad4be + python services and python nginx conf example
+ also example of Dockerfile for python project and needed to place onto your project directory
2025-04-08 17:13:21 +03:00
cb5c989830 * simple renaming 2025-01-31 00:20:12 +03:00
3ed6f5dfff + quick script for nodejs docker compose yml fast interactions 2025-01-20 12:51:27 +03:00
8299d7276a + gzip config example for nginx 2025-01-17 14:29:01 +03:00
50148659c8 + additional doc for detect your gateway/host ip in docker network and describe how to ufw allow appropriate ports 2025-01-16 09:21:37 +03:00
65c9b61c51 * force to restart php fpm container after turn on / off xdebug 2025-01-16 08:59:41 +03:00
e699876976 * use helpers script with dot version function for xdebug start and quit script
* condionaly laynch sed tunr on profile options for php 74 & correct appropriate logic
2025-01-15 13:17:54 +03:00
21140eab2d * automatic install redis in pecl
* correct for dot style version notation of php images tagged and pushed into docker hub
2025-01-15 11:17:10 +03:00
1ea5e96fcb * use dc alias from host system shell for execute docker compopse helper commands (and depended by os docker composer or docker-compose command style)
* extend quick helper script with settings and dynamic php version variable
* link redis-local config as volume & correct include path
* minio access keys moved to conrecte service instance
* corrected used php version for workspace81
2025-01-15 11:04:59 +03:00
49e44c9229 + php src container fully refactored and lightweight
* on host system container also refactored, some env options moved from .env to docker-compose example
* dnsmasq now is separate service file
+ php 8.3 support
* xdebug launch also refactored and lightweight
* tested and worked python environment with pyenv (on today without supervisor)
* database container and appropriate gui applications for management database systems moved into separate service files
+ build src php container helper
- remove unnecessary docker compose file version directive
- remove minio thing from the host php services
* use redis-local.conf from example and lightweight main redis conf file
2025-01-13 18:16:42 +03:00
57c56567cf * use full database container name for detect id of db container for mariadb-dump operations 2025-01-06 14:14:14 +03:00
2695d1f759 Merge branch 'refs/heads/master' into uvicorn
# Conflicts:
#	dockerfiles/workspace/.shell-aliases
2024-11-25 09:18:57 +03:00
3cb9b6e925 + supervisor, python and uvicorn in workspace74 (partially commit - no fully worked solution) 2024-11-25 09:18:19 +03:00
4e0c2dbfc4 * minor local changes - unused shell aliases and some slash 2024-11-25 09:13:53 +03:00
3faf8a698a + root mariadb account default extra file
* pma and inbucket port presented in docker compose example file (do not use that for prod environment with this docker structure build)
2024-11-20 15:36:12 +03:00
f3b9303754 + allowing * domains for acceptable connections by cors politic - allowing downloading files from uploads dir from scripting download 2024-11-07 16:20:43 +03:00
0e1bd3246d + default time zone for mariadb 2024-11-02 12:18:14 +03:00
184fc3dc2d + optional ssl for nginx 2024-10-18 15:33:35 +03:00
2db44cb74e + mysqld example config with explicit_defaults_for_timestamp option 2024-09-29 10:26:52 +03:00
e17103f4ab * proxy buffers need for nuxt projects 2024-09-18 13:34:53 +03:00
e59e976cd9 + increase proxy buffers for headers from proxy upstream & increase client header buffers 2024-09-18 13:32:32 +03:00
33a0756530 + directus docker service for mi project with nginx config 2024-09-17 15:57:45 +03:00
5c1c94bfe2 + conditionally libreoffice install for php 2024-08-28 18:31:49 +03:00
46a0154871 + libreoffice-nogui is installed in php81, php.82, workspace81 and workspace82 images 2024-08-27 15:30:04 +03:00
25368c8408 * updated dnsmasq to 2.90 (+ dnsmasq example config) 2024-08-23 18:44:02 +03:00
c37ff438d8 * updated dnsmasq to 2.90 2024-08-23 18:43:23 +03:00
b0cd920e41 * simplified browserless service configuration 2024-08-08 21:57:45 +03:00
dc3b0a76a7 * close pma & inblucket ports
+ auth and example nginx config for local phpmyadmin service
2024-08-06 19:40:40 +03:00
35baceb62a + php8.2 example docker compose service
+ e2e example docker compose config file with browserless service
2024-08-06 19:17:47 +03:00
f63747e59f + fastcgi setting SERVER_NAME for correctly working xdebug with some server names config 2024-07-08 15:33:11 +03:00
1677ffe648 + change ip for host.docker.internal to localhost on windows hosts file (example for correctly working vite_dev server both from host browser and docker browserless browser) 2024-06-07 14:54:13 +03:00
32b98ae170 + php82 src image 2024-04-15 16:55:28 +03:00
5dcd3a131c + artisan bash autocompletion
* turn off mc client from workspace base image
2024-04-07 16:19:37 +03:00
a3f7465955 + nodejs applications support with pm2 manager
* use dockerhost in xdebug3 config for php8 in workspace
* set local docker resolver for nginx
* refactored base configs (join in one base config) and better separate examples for third party services
* set default web port for inbucket to 82 instead of 9090, because last use for cockpit
2024-02-16 17:36:20 +03:00
a244fec29a + support with profiler option for xdebug3 2023-12-19 17:31:02 +03:00
eb64cd702a + true script dir option for fetching related bash-scripts config on some quick commands 2023-11-22 15:54:46 +03:00
fd7c8b9ac1 * xdebug config for workspace81 2023-11-18 18:14:21 +03:00
2049580005 * set default php version to 81 in quick scripts 2023-11-18 17:42:59 +03:00
121 changed files with 3021 additions and 2965 deletions

View File

@ -1,29 +1,30 @@
# Enter your Docker Host IP (will be appended to /etc/hosts). Default is `10.0.75.1` # Enter your gateway IP (your host IP under from docker containers) - that need for correctly worked xdebug from cli
DOCKER_HOST_IP=172.20.0.1 # 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 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 #############################################
WORKSPACE_PUID=1000 WORKSPACE_PUID=1000
WORKSPACE_PGID=1000 WORKSPACE_PGID=1000
WORKSPACE_TIMEZONE=Europe/Moscow
WORKSPACE_LEGACY_COMPOSER_VERSION=1 WORKSPACE_INSTALL_YADM=true
WORKSPACE_LEGACY_NODE_VERSION=lts/fermium WORKSPACE_INSTALL_FINE_UTILS=true
WORKSPACE_COMPOSER_VERSION=2 WORKSPACE_INSTALL_SSH=true
WORKSPACE_NODE_VERSION=lts/hydrogen
WORKSPACE_PHP_OPT_MAX_EXECUTION_TIME=0
WORKSPACE_PHP_OPT_MEMORY_LIMIT=-1 WORKSPACE_PHP_OPT_MEMORY_LIMIT=-1
### PHP-FPM ############################################# ### PHP-FPM #############################################
INSTALL_REDIS=true PHP_OPT_MEMORY_LIMIT=512M
INSTALL_PEAR_MAIL=true
PHP_OPT_SHORT_OPEN_TAG=Off
PHP_OPT_MAX_EXECUTION_TIME=600
PHP_OPT_MEMORY_LIMIT=256M
PHP_OPT_POST_MAX_SIZE=800M PHP_OPT_POST_MAX_SIZE=800M
PHP_OPT_UPLOAD_MAX_FILESIZE=200M PHP_OPT_UPLOAD_MAX_FILESIZE=200M
### MINIO S3 ############################################# PHP_OPT_MAX_EXECUTION_TIME=600
MINIO_ACCESS_KEY=s3.local
MINIO_SECRET_KEY=qbKTLqAumjYOYlCXCRk6

8
.gitignore vendored
View File

@ -1,6 +1,6 @@
/.idea /.idea
/dockerfiles/ypt-encoder
/docker-compose.yml
/docker-compose.elastic.yml
/.env /.env
/*.komodoproject /docker-compose*
!/docker-compose.base.yml
!/docker-compose*.example
/config/nginx/includes.d/auth.passwd

5
bash/_helpers.sh Normal file
View File

@ -0,0 +1,5 @@
function dot_version() {
sed -r 's/^([[:digit:]])/\1./g' <<< $1
}
export -f dot_version

View 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

View File

@ -1,5 +1,5 @@
#!/bin/bash #!/bin/bash
CONTAINER=$(docker ps | grep db | awk '{print $1}') CONTAINER=$(docker ps | grep mariadb | awk '{print $1}')
if [[ -z "${CONTAINER}" ]]; then if [[ -z "${CONTAINER}" ]]; then
echo "Unable to find container: db" echo "Unable to find container: db"

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
. $DIR/bash/_docker-cmd.sh || { . $SCRIPT_DIR/_docker-cmd.sh || {
echo "no docker cmd is presented" && exit 1 echo "no docker cmd is presented" && exit 1
} }

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
. $DIR/bash/_docker-cmd.sh || { . $SCRIPT_DIR/_docker-cmd.sh || {
echo "no docker cmd is presented" && exit 1 echo "no docker cmd is presented" && exit 1
} }

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
. $DIR/bash/_docker-cmd.sh || { . $SCRIPT_DIR/_docker-cmd.sh || {
echo "no docker cmd is presented" && exit 1 echo "no docker cmd is presented" && exit 1
} }

6
bash/nginx-ssl-gen.sh Normal file
View 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
View 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
View 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}

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
. $DIR/bash/_docker-cmd.sh || { . $SCRIPT_DIR/_docker-cmd.sh || {
echo "no docker cmd is presented" && exit 1 echo "no docker cmd is presented" && exit 1
} }

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
. $DIR/bash/_docker-cmd.sh || { . $SCRIPT_DIR/_docker-cmd.sh || {
echo "no docker cmd is presented" && exit 1 echo "no docker cmd is presented" && exit 1
} }

View File

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
# Not working on windows symlinks
DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)"
GENERAL_LOG_FILE_PATH="${DIR}/log/mariadb/mariadb.log" GENERAL_LOG_FILE_PATH="${DIR}/log/mariadb/mariadb.log"

9
bash/tail-nginx-access-log.sh Executable file
View 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
View 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

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
. $DIR/bash/_docker-cmd.sh || { . $SCRIPT_DIR/_docker-cmd.sh || {
echo "no docker cmd is presented" && exit 1 echo "no docker cmd is presented" && exit 1
} }

View File

@ -1,16 +1,45 @@
#!/bin/bash #!/bin/bash
DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
PHP_VERSION=$1 # Without dot set -e
WITH_PROFILER=$2
. $SCRIPT_DIR/_helpers.sh || {
echo "no helpers" && exit 1
}
cd "$SCRIPT_DIR/.."
PHP_VERSION=$1
if [[ -z "${PHP_VERSION}" ]]; then PHP_VERSION=81; fi if [[ -z "${PHP_VERSION}" ]]; then PHP_VERSION=81; fi
POSSIBLE_XDEBUG_VERSION=xdebug2 WITH_PROFILER=$2
if [[ $PHP_VERSION -ge 81 ]]; then PHP_DOT_VERSION=$(dot_version ${PHP_VERSION})
POSSIBLE_XDEBUG_VERSION=xdebug3
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 fi
${DIR}/dockerfiles/php-fpm/${POSSIBLE_XDEBUG_VERSION}/xdebug.sh stop ${PHP_VERSION} ${WITH_PROFILER} docker exec -it "${PHP_FPM_CONTAINER}" bash -c "${SED_PROFILER_OFF} ${PHP_FPM_XDEBUG_CONFIG_PATH}"
${DIR}/dockerfiles/workspace/xdebug.sh stop ${PHP_VERSION} ${WITH_PROFILER} docker exec -it "${WORKSPACE_CONTAINER}" bash -c "${SED_PROFILER_OFF} ${WORKSPACE_XDEBUG_CONFIG_PATH}"
docker restart "${PHP_FPM_CONTAINER}"

View File

@ -1,16 +1,58 @@
#!/bin/bash #!/bin/bash
DIR="$(realpath $(dirname "$(readlink -f "$0")")/..)" # 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")"))"
PHP_VERSION=$1 # Without dot set -e
WITH_PROFILER=$2
. $SCRIPT_DIR/_helpers.sh || {
echo "no helpers" && exit 1
}
cd "$SCRIPT_DIR/.."
PHP_VERSION=$1
if [[ -z "${PHP_VERSION}" ]]; then PHP_VERSION=81; fi if [[ -z "${PHP_VERSION}" ]]; then PHP_VERSION=81; fi
POSSIBLE_XDEBUG_VERSION=xdebug2 WITH_PROFILER=$2
if [[ $PHP_VERSION -ge 81 ]]; then PHP_DOT_VERSION=$(dot_version ${PHP_VERSION})
POSSIBLE_XDEBUG_VERSION=xdebug3
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 fi
${DIR}/dockerfiles/php-fpm/${POSSIBLE_XDEBUG_VERSION}/xdebug.sh start ${PHP_VERSION} ${WITH_PROFILER} if [ -n "${SED_DEBUG_OR_PROFILER_MODE_ON}" ]; then
${DIR}/dockerfiles/workspace/xdebug.sh start ${PHP_VERSION} ${WITH_PROFILER} 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
View File

@ -0,0 +1,3 @@
*
!.gitignore
!.example

View 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

View File

@ -0,0 +1,3 @@
[mysqld]
explicit_defaults_for_timestamp = ON
default_time_zone = '+03:00'

View File

@ -0,0 +1,3 @@
[client]
user = root
password = 123456

View 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;

View File

@ -21,7 +21,7 @@ map $http_accept $webp_suffix {
"~*webp" ".webp"; "~*webp" ".webp";
} }
resolver 8.8.8.8; resolver 127.0.0.11;
map $http_host $uploads_upstream { map $http_host $uploads_upstream {
wordpress.local.wpstudio.ru "https://somewp.site"; wordpress.local.wpstudio.ru "https://somewp.site";
@ -35,6 +35,7 @@ server {
include includes.d/octobercms.conf; include includes.d/octobercms.conf;
include includes.d/staticfiles.conf; include includes.d/staticfiles.conf;
client_max_body_size 300M; client_max_body_size 300M;
large_client_header_buffers 4 32k;
location ~ ^/index.php { location ~ ^/index.php {
fastcgi_pass php81; fastcgi_pass php81;
include fastcgi_params; include fastcgi_params;

View 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;
}
}

View 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;
}
}

View 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;
}
}

View 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;
}
}

View File

@ -25,6 +25,7 @@ server {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SERVER_NAME $host;
fastcgi_pass php74; fastcgi_pass php74;
fastcgi_index index.php; fastcgi_index index.php;
@ -55,6 +56,7 @@ server {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info; fastcgi_param PATH_INFO $fastcgi_path_info;
fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info; fastcgi_param PATH_TRANSLATED $document_root$fastcgi_path_info;
fastcgi_param SERVER_NAME $host;
fastcgi_pass php74; fastcgi_pass php74;
fastcgi_index index.php; fastcgi_index index.php;

View 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

View 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;
}

View File

@ -1,47 +1,56 @@
location / {
rewrite ^/.*$ /index.php last;
}
location ~ ^/combine.*\.(css|js) {
rewrite ^/.*$ /index.php last;
expires max;
}
location / { # Whitelist
rewrite ^/.*$ /index.php last;
}
location ~ ^/combine.*\.(css|js) {
rewrite ^/.*$ /index.php last;
expires max;
}
# Whitelist ## Let October handle if static file not exists
## Let October handle if static file not exists
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; }
## Let nginx return 404 if static file not exists location = /favicon.ico { try_files $uri /index.php; }
location /storage/app/uploads/public { try_files $uri /404; } location ~ ^/.*\.xml { try_files $uri /index.php; }
location /storage/app/media { try_files $uri /404; } location = /robots.txt { try_files $uri /index.php; }
location /storage/app/yml { try_files $uri /404; } location = /humans.txt { try_files $uri /index.php; }
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; } ## Let nginx return 404 if static file not exists
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 /storage/app/uploads/public {
location ~ ^/plugins/.*/.*/resources { try_files $uri /404; } # add proxy cors headers
location ~ ^/plugins/.*/.*/behaviors/.*/assets { try_files $uri /404; } add_header Access-Control-Allow-Headers "*" always;
location ~ ^/plugins/.*/.*/behaviors/.*/resources { try_files $uri /404; } add_header Access-Control-Allow-Methods "*" always;
location ~ ^/plugins/.*/.*/reportwidgets/.*/assets { try_files $uri /404; } add_header Access-Control-Allow-Origin "*" always;
location ~ ^/plugins/.*/.*/reportwidgets/.*/resources { try_files $uri /404; } 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; } 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; }

2
config/nginx/ssl.d/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

1
config/redis/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/redis-local.conf

View 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

File diff suppressed because it is too large Load Diff

3
config/supervisor/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
*
!*.example
!.gitignore

View 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

6
dc-node Executable file
View 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
View 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"

View File

@ -1,27 +1,32 @@
version: '3.6'
services: services:
nginx: nginx:
image: nginx image: nginx
restart: always restart: always
volumes: volumes:
- ${PROJECTS_DIR}:/usr/share/nginx/html - ${PROJECTS_DIR}:/usr/share/nginx/html
- ${PYTHON_PROJECTS_DIR}:/usr/share/nginx/python
- ./config/nginx/conf.d:/etc/nginx/conf.d - ./config/nginx/conf.d:/etc/nginx/conf.d
- ./config/nginx/includes.d:/etc/nginx/includes.d - ./config/nginx/includes.d:/etc/nginx/includes.d
- ./config/nginx/ssl.d:/etc/nginx/ssl.d
- ./log/nginx:/var/log/nginx - ./log/nginx:/var/log/nginx
ports: ports:
- "80:80" - "80:80"
- "443:443"
php: php:
build: build:
context: ./dockerfiles/php-fpm context: ./dockerfiles/php-fpm
args: args:
- INSTALL_REDIS=${INSTALL_REDIS} - CUSTOM_TZ=${CUSTOM_TZ}
- INSTALL_PEAR_MAIL=${INSTALL_PEAR_MAIL} - CUSTOM_LOCALE=${CUSTOM_LOCALE}
- 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_MEMORY_LIMIT=${PHP_OPT_MEMORY_LIMIT}
- PHP_OPT_POST_MAX_SIZE=${PHP_OPT_POST_MAX_SIZE} - PHP_OPT_POST_MAX_SIZE=${PHP_OPT_POST_MAX_SIZE}
- PHP_OPT_UPLOAD_MAX_FILESIZE=${PHP_OPT_UPLOAD_MAX_FILESIZE} - 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 restart: always
volumes: volumes:
- ${PROJECTS_DIR}:/usr/share/nginx/html - ${PROJECTS_DIR}:/usr/share/nginx/html
@ -30,15 +35,31 @@ services:
build: build:
context: ./dockerfiles/workspace context: ./dockerfiles/workspace
args: args:
- CUSTOM_TZ=${CUSTOM_TZ}
- CUSTOM_LOCALE=${CUSTOM_LOCALE}
- CUSTOM_PUID=${WORKSPACE_PUID} - CUSTOM_PUID=${WORKSPACE_PUID}
- CUSTOM_PGID=${WORKSPACE_PGID} - CUSTOM_PGID=${WORKSPACE_PGID}
- CUSTOM_TZ=${WORKSPACE_TIMEZONE} - INSTALL_YADM=${WORKSPACE_INSTALL_YADM}
- PHP_OPT_SHORT_OPEN_TAG=${PHP_OPT_SHORT_OPEN_TAG} - INSTALL_FINE_UTILS=${WORKSPACE_INSTALL_FINE_UTILS}
- PHP_OPT_MAX_EXECUTION_TIME=${WORKSPACE_PHP_OPT_MAX_EXECUTION_TIME} - INSTALL_SSH=${WORKSPACE_INSTALL_SSH}
- PHP_OPT_MEMORY_LIMIT=${WORKSPACE_PHP_OPT_MEMORY_LIMIT} - 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 restart: always
volumes: volumes:
- ${PROJECTS_DIR}:/var/www - ${PROJECTS_DIR}:/var/www
- ./data/profiler:/tmp/profiler
- ./config/supervisor:/etc/supervisor/conf.d
extra_hosts: extra_hosts:
- "dockerhost:${DOCKER_HOST_IP}" - "dockerhost:${DOCKER_HOST_IP}"
secrets: secrets:
@ -50,13 +71,13 @@ services:
restart: always restart: always
environment: environment:
MYSQL_ROOT_PASSWORD: 123456 MYSQL_ROOT_PASSWORD: 123456
ports:
- "3306:3306"
volumes: volumes:
- database:/var/lib/mysql - database:/var/lib/mysql
- ./hostfiles:/hostfiles - ./hostfiles:/hostfiles
- ./log/mariadb:/var/log/mariadb - ./log/mariadb:/var/log/mariadb
- ./config/mariadb:/etc/mysql/conf.d - ./config/mariadb:/etc/mysql/conf.d
security_opt:
- seccomp=unconfined
pma: pma:
image: phpmyadmin/phpmyadmin image: phpmyadmin/phpmyadmin
restart: always restart: always
@ -64,17 +85,39 @@ services:
PMA_HOST: db PMA_HOST: db
PMA_USER: root PMA_USER: root
PMA_PASSWORD: 123456 PMA_PASSWORD: 123456
ports:
- "81:80"
inbucket: inbucket:
image: inbucket/inbucket image: inbucket/inbucket
restart: always restart: always
ports: expose:
- "2500:2500" - 2500
- "9090:9000"
redis: redis:
image: redis image: redis
restart: always restart: always
command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ] command: [ "redis-server", "/usr/local/etc/redis/redis.conf" ]
volumes: volumes:
- ./config/redis/redis.conf:/usr/local/etc/redis/redis.conf - ./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

View 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"

View 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
View 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"

View File

@ -1,18 +0,0 @@
version: '3.6'
services:
elastic:
build:
context: ./dockerfiles/elastic
restart: on-failure
environment:
- discovery.type=single-node
- "ES_JAVA_OPTS=-Xms512m -Xmx512m"
ulimits:
memlock:
soft: -1
hard: -1
mem_limit: 2g
expose:
- "9200"
- "9300"

View File

@ -1,9 +1,7 @@
version: '3.6'
services: services:
elastic: elastic:
extends: extends:
file: docker-compose.elastic.base.yml file: docker-compose.base.yml
service: elastic service: elastic
restart: always restart: always
build: build:

View File

@ -1,16 +1,4 @@
version: '3.6'
services: services:
dbpg:
image: postgres
restart: always
environment:
POSTGRES_PASSWORD: postgres
volumes:
- databasepg:/var/lib/postgresql/data
- ./hostfiles:/hostfiles
ports:
- "5432:5432"
adminer: adminer:
image: adminer image: adminer
restart: always restart: always
@ -26,6 +14,3 @@ services:
- "83:80" - "83:80"
volumes: volumes:
- ./hostfiles/pgadmin:/var/lib/pgadmin - ./hostfiles/pgadmin:/var/lib/pgadmin
volumes:
databasepg:

View File

@ -1,5 +1,3 @@
version: '3.6'
services: services:
redis-ui: redis-ui:
image: marian/rebrow image: marian/rebrow

View 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:

View File

@ -1,10 +0,0 @@
version: '3.6'
services:
minio:
image: minio/minio:RELEASE.2020-06-12T00-06-19Z
restart: always
environment:
MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY}
MINIO_SECRET_KEY: ${MINIO_SECRET_KEY}
command: server /minio

View File

@ -1,12 +1,13 @@
version: '3.6'
services: services:
minio: minio:
extends: extends:
file: docker-compose.minio.base.yml file: docker-compose.base.yml
service: minio service: minio
volumes: volumes:
- minio:/minio - minio:/minio
environment:
MINIO_ACCESS_KEY:
MINIO_SECRET_KEY:
volumes: volumes:
minio: minio:

View 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

View 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:

View 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
"

View 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

View File

@ -1,5 +1,3 @@
version: '3.6'
services: services:
sphinx: sphinx:
build: ./dockerfiles/sphinx build: ./dockerfiles/sphinx

View File

@ -1,5 +1,3 @@
version: '3.9'
services: services:
nginx: nginx:
extends: extends:
@ -8,7 +6,10 @@ services:
networks: networks:
default: default:
aliases: aliases:
- loc.yoursite.ru - someproject.local.wpstudio.ru
depends_on:
- php74
- php81
php74: php74:
extends: extends:
file: docker-compose.base.yml file: docker-compose.base.yml
@ -21,6 +22,18 @@ services:
service: php service: php
build: build:
dockerfile: php81.Dockerfile 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: workspace74:
extends: extends:
file: docker-compose.base.yml file: docker-compose.base.yml
@ -33,29 +46,24 @@ services:
service: workspace service: workspace
build: build:
dockerfile: workspace81.Dockerfile dockerfile: workspace81.Dockerfile
db: workspace82:
extends: extends:
file: docker-compose.base.yml file: docker-compose.base.yml
service: db service: workspace
pma: build:
dockerfile: workspace82.Dockerfile
workspace83:
extends: extends:
file: docker-compose.base.yml file: docker-compose.base.yml
service: pma service: workspace
build:
dockerfile: workspace83.Dockerfile
inbucket: inbucket:
extends: extends:
file: docker-compose.base.yml file: docker-compose.base.yml
service: inbucket service: inbucket
redis: ports:
extends: - "82:9000"
file: docker-compose.base.yml
service: redis
redis-some:
extends:
file: docker-compose.base.yml
service: redis
volumes:
database:
secrets: secrets:
user_ssh_key: user_ssh_key:
@ -63,4 +71,5 @@ secrets:
user_known_hosts: user_known_hosts:
file: ~/.ssh/known_hosts file: ~/.ssh/known_hosts
composer_auth: composer_auth:
# If in your system installed Composer V1 use ~/.composer/auth.json
file: ~/.config/composer/auth.json file: ~/.config/composer/auth.json

View 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"]

View File

@ -1,9 +0,0 @@
; Load igbinary extension
;extension=igbinary.so
; Use igbinary as session serializer
session.serialize_handler=igbinary
; Enable or disable compacting of duplicate strings
; The default is On.
igbinary.compact_strings=On

View 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/*

View File

@ -1,43 +0,0 @@
FROM dimti/php:5.6
###########################################################################
# 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
###########################################################################
# xDebug (termporary):
###########################################################################
# Copy xdebug configuration for remote debugging
COPY ./xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
###########################################################################
# Permission denied on /tmp folder:
###########################################################################
RUN chmod 1777 /tmp
###########################################################################
# Tune opts:
###########################################################################
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=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_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=48M
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=16M
RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini"

View File

@ -1,62 +1,7 @@
# syntax = edrevo/dockerfile-plus
FROM dimti/php:7.4 FROM dimti/php:7.4
########################################################################### ARG PHP_VERSION=7.4
# Redis and igbinary: ENV PHP_VERSION ${PHP_VERSION}
###########################################################################
ARG INSTALL_REDIS=false INCLUDE+ ./php.base.Dockerfile
COPY ./igbinary.ini /usr/local/etc/php/conf.d/igbinary.ini
RUN if [ ${INSTALL_REDIS} = true ]; then \
pecl install -a igbinary \
&& docker-php-ext-enable igbinary \
&& printf "yes\n" | pecl install redis \
&& docker-php-ext-enable redis \
;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
###########################################################################
# xDebug (termporary):
###########################################################################
# Copy xdebug configuration for remote debugging
COPY ./xdebug2/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
###########################################################################
# НУЦ:
###########################################################################
RUN 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
###########################################################################
# Tune opts:
###########################################################################
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=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_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=48M
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=16M
RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini"

View File

@ -1,52 +1,7 @@
# syntax = edrevo/dockerfile-plus
FROM dimti/php:8.1 FROM dimti/php:8.1
########################################################################### ARG PHP_VERSION=8.1
# Redis and igbinary: ENV PHP_VERSION ${PHP_VERSION}
###########################################################################
ARG INSTALL_REDIS=false INCLUDE+ ./php.base.Dockerfile
COPY ./igbinary.ini /usr/local/etc/php/conf.d/igbinary.ini
RUN if [ ${INSTALL_REDIS} = true ]; then \
pecl install -a igbinary \
&& docker-php-ext-enable igbinary \
&& printf "yes\n" | pecl install redis \
&& docker-php-ext-enable redis \
;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
###########################################################################
# xDebug (termporary):
###########################################################################
# Copy xdebug configuration for remote debugging
COPY ./xdebug3/xdebug.ini /usr/local/etc/php/conf.d/xdebug.ini
###########################################################################
# Tune opts:
###########################################################################
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=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_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=48M
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=16M
RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini"

View 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

View 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

View File

@ -1,87 +0,0 @@
#! /bin/bash
# NOTE: At the moment, this has only been confirmed to work with PHP 7
PHP_VERSION=$2 # Without dot
WITH_PROFILER=$3
# Grab full name of php-fpm container
PHP_FPM_CONTAINER=$(docker ps | grep php${PHP_VERSION} | awk '{print $1}')
if [[ -z "${PHP_FPM_CONTAINER}" ]]; then
echo "Unable to find php fpm container: php${PHP_VERSION}"
exit 1
fi
if [[ ! -z "${WITH_PROFILER}" ]]; then
echo "With profiler option".
fi
xdebug_status ()
{
echo 'xDebug status'
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
}
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"
REMOTE_AUTOSTART_CMD="sed -i 's/^xdebug.remote_autostart=0/xdebug.remote_autostart=1/g' /usr/local/etc/php/conf.d/xdebug.ini"
REMOTE_ENABLE_CMD="sed -i 's/^xdebug.remote_enable=0/xdebug.remote_enable=1/g' /usr/local/etc/php/conf.d/xdebug.ini"
PROFILER_ENABLE_CDM="sed -i 's/^xdebug.profiler_enable=0/xdebug.profiler_enable=1/g' /usr/local/etc/php/conf.d/xdebug.ini"
docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_AUTOSTART_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_ENABLE_CMD}"
if [[ ! -z "${WITH_PROFILER}" ]]; then
docker exec -it $PHP_FPM_CONTAINER bash -c "${PROFILER_ENABLE_CDM}"
fi
docker restart $PHP_FPM_CONTAINER
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
}
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"
REMOTE_AUTOSTART_CMD="sed -i 's/^xdebug.remote_autostart=1/xdebug.remote_autostart=0/g' /usr/local/etc/php/conf.d/xdebug.ini"
REMOTE_ENABLE_CMD="sed -i 's/^xdebug.remote_enable=1/xdebug.remote_enable=0/g' /usr/local/etc/php/conf.d/xdebug.ini"
PROFILER_DISABLE_CMD="sed -i 's/^xdebug.profiler_enable=1/xdebug.profiler_enable=0/g' /usr/local/etc/php/conf.d/xdebug.ini"
docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_AUTOSTART_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${REMOTE_ENABLE_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${PROFILER_DISABLE_CMD}"
# docker-compose restart php-fpm
docker restart $PHP_FPM_CONTAINER
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
}
case $1 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.sh 73|74 stop|start|status"
esac
exit 1

View File

@ -1,77 +0,0 @@
#! /bin/bash
# NOTE: At the moment, this has only been confirmed to work with PHP 7
PHP_VERSION=$2 # Without dot
WITH_PROFILER=$3
# Grab full name of php-fpm container
PHP_FPM_CONTAINER=$(docker ps | grep php${PHP_VERSION} | awk '{print $1}')
if [[ -z "${PHP_FPM_CONTAINER}" ]]; then
echo "Unable to find php fpm container: php${PHP_VERSION}"
exit 1
fi
if [[ ! -z "${WITH_PROFILER}" ]]; then
echo "With profiler option".
fi
xdebug_status ()
{
echo 'xDebug status'
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
}
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"
MODE_DEBUG_CMD="sed -i 's/^xdebug.mode.*/xdebug.mode=debug/g' /usr/local/etc/php/conf.d/xdebug.ini"
docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${MODE_DEBUG_CMD}"
docker restart $PHP_FPM_CONTAINER
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
}
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"
MODE_OFF_CMD="sed -i 's/^xdebug.mode.*/xdebug.mode=off/g' /usr/local/etc/php/conf.d/xdebug.ini"
docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}"
docker exec -it $PHP_FPM_CONTAINER bash -c "${MODE_OFF_CMD}"
# docker-compose restart php-fpm
docker restart $PHP_FPM_CONTAINER
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
}
case $1 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.sh 73|74 stop|start|status"
esac
exit 1

View File

@ -0,0 +1,5 @@
FROM keymetrics/pm2:18-buster
COPY ./ecosystem.config.js /ecosystem.config.js
CMD ["pm2-runtime", "start", "ecosystem.config.js"]

View File

@ -0,0 +1,11 @@
module.exports = {
apps: [
{
name: 'NuxtAppName',
port: '3000',
exec_mode: 'cluster',
instances: '2',
script: './.output/server/index.mjs',
},
],
};

View 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

View File

@ -0,0 +1,2 @@
Как вы уже поняли, это файл должен лежать в корневой директории проекта,
так как нужно копировать от туда requirements.txt при сборке образа.

View File

@ -1,2 +0,0 @@
/aliases.sh
/crontab

View File

@ -1,30 +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
# Always use color output for `ls`
alias ls="command ls ${colorflag}"
alias gst='git status'
alias ga='git add'
alias gc='git commit -m'
alias gush='git push'
alias gull='git pull'
alias gb='git branch'

View File

@ -1 +0,0 @@
#* * * * * laradock /usr/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1

View File

@ -0,0 +1 @@
#* * * * * laradock /usr/bin/php /var/www/yourproject/artisan schedule:run >> /dev/null 2>&1

View File

@ -0,0 +1,2 @@
*
!.gitignore

View File

@ -1,12 +0,0 @@
{
"version": "10",
"aliases": {
"local": {
"url": "http://minio:9000",
"accessKey": "s3.local",
"secretKey": "qbKTLqAumjYOYlCXCRk6",
"api": "S3v4",
"path": "auto"
}
}
}

View File

@ -0,0 +1,304 @@
###########################################################################
# 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
###########################################################################
# Laradock non-root user:
###########################################################################
ARG CUSTOM_PUID=1000
ARG CUSTOM_PGID=1000
RUN if [ ${CUSTOM_PUID} -nq 1000 ]; then \
usermod -u ${CUSTOM_PUID} laradock \
;fi
RUN if [ ${CUSTOM_PGID} -nq 1000 ]; then \
groupmod -g ${CUSTOM_PGID} laradock \
chown -R :${CUSTOM_PGID} /home/laradock \
;fi
###########################################################################
# Update composer version if needed
###########################################################################
USER root
ARG COMPOSER_VERSION=2
RUN set -e; if [ ${COMPOSER_VERSION} -ne 2 ]; then \
composer self-update --${COMPOSER_VERSION}; \
mkdir -p ${HOME}/.composer; \
ln -s /run/secrets/composer_auth ${HOME}/.composer/auth.json; \
else \
mkdir -p ${HOME}/.config/composer; \
ln -s /run/secrets/composer_auth ${HOME}/.config/composer/auth.json; \
fi
###########################################################################
# 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
###########################################################################
# 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
###########################################################################
# Node / NVM:
###########################################################################
ARG INSTALL_NODE=false
ARG NODE_VERSION=v18.18.0
ENV NODE_VERSION ${NODE_VERSION}
USER laradock
ENV NVM_DIR /home/laradock/.nvm
RUN if [ ${INSTALL_NODE} = true ]; then \
mkdir -p $NVM_DIR && \
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash \
&& . $NVM_DIR/nvm.sh \
;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
USER root
RUN if [ ${INSTALL_NODE} = true ]; then \
. ~/.bashrc && nvm install ${NODE_VERSION} \
&& . ~/.bashrc && nvm alias default ${NODE_VERSION} \
&& npm i -g yarn \
&& cp -R ~/.nvm/alias /home/laradock/.nvm \
&& cp -R ~/.nvm/versions /home/laradock/.nvm \
&& chown -R ${CUSTOM_PUID}:${CUSTOM_PGID} /home/laradock/.nvm \
;fi
###########################################################################
# ssh:
###########################################################################
USER root
ARG INSTALL_SSH=false
ENV INSTALL_SSH ${INSTALL_SSH}
RUN if [ ${INSTALL_SSH} = true ]; then \
rm -f /etc/service/sshd/down \
;fi
USER laradock
RUN if [ ${INSTALL_SSH} = true ]; then \
mkdir -p ~/.ssh \
&& ln -s /run/secrets/user_ssh_key ~/.ssh/id_rsa \
&& ln -s /run/secrets/user_known_hosts ~/.ssh/known_hosts \
;fi
###########################################################################
# APT
###########################################################################
USER root
# once please
RUN apt update -qq
###########################################################################
# YADM
###########################################################################
ARG INSTALL_YADM=true
USER root
RUN if [ ${INSTALL_YADM} = true ]; then \
apt-get install direnv yadm tmux -qq && \
curl -sS https://starship.rs/install.sh | sh -s -- -f && \
yadm clone --bootstrap https://vcs.wpstudio.ru/gitea/dotfiles.git \
;fi
USER laradock
RUN if [ ${INSTALL_YADM} = true ]; then \
yadm clone --bootstrap https://vcs.wpstudio.ru/gitea/dotfiles.git && \
sed -i 's/#/\\$/g' ${HOME}/.config/starship.toml \
;fi
###########################################################################
# FINE UTILS:
###########################################################################
USER root
ARG INSTALL_FINE_UTILS=false
RUN if [ ${INSTALL_FINE_UTILS} = true ]; then \
apt-get install htop wget unzip curl grep dbview -qq \
;fi
###########################################################################
# SUPERVISOR:
###########################################################################
USER root
ARG INSTALL_SUPERVISOR=false
RUN if [ ${INSTALL_SUPERVISOR} = true ]; then \
apt-get install supervisor -qq \
;fi
###########################################################################
# PYTHON & UVICORN:
###########################################################################
USER root
ARG INSTALL_PYTHON=false
RUN if [ ${INSTALL_PYTHON} = true ]; then \
apt-get install liblzma-dev libbz2-dev libffi-dev libreadline-dev zlib1g-dev -qq --no-install-recommends \
;fi
USER laradock
SHELL ["/bin/bash", "-c"]
ARG PYTHON_VERSION=3.12
ENV PYENV_VERSION=${PYTHON_VERSION}
RUN if [ ${INSTALL_PYTHON} = true ]; then \
set -e; \
curl https://pyenv.run | bash &&\
echo '' >> ~/.shell-env.local && \
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.shell-env.local && \
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.shell-env.local && \
echo 'eval "$(pyenv init -)"' >> ~/.shell-env.local && \
echo '' >> ~/.shell-env.local && \
echo 'eval "$(pyenv virtualenv-init -)"' >> ~/.shell-env.local && \
echo '' >> ~/.shell-env.local && \
$HOME/.pyenv/bin/pyenv install ${PYTHON_VERSION} \
;fi
RUN if [ ${INSTALL_PYTHON} = true ]; then \
bash -ic 'python -m pip install uvicorn' \
;fi
RUN if [ false = true ]; then \
python -m pip install uvicorn && \
python -m pip install --upgrade supervisor && \
echo_supervisord_conf > /etc/supervisord.conf && \
sed -i 's/\;\[include\]/\[include\]/g' /etc/supervisord.conf && \
sed -i 's/\;files\s.*/files = supervisord.d\/*.conf/g' /etc/supervisord.conf \
;fi
SHELL ["/bin/sh", "-c"]
###########################################################################
# Libreoffice
###########################################################################
USER root
ARG INSTALL_LIBREOFFICE=false
RUN if [ ${INSTALL_LIBREOFFICE} = true ]; then \
add-apt-repository -y ppa:libreoffice/ppa \
&& 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" /etc/php/${PHP_VERSION}/cli/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" /etc/php/${PHP_VERSION}/cli/php.ini
###########################################################################
# Cleanup & Crontab
###########################################################################
USER root
# Clean up
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY ./crontab/* /etc/cron.d/
RUN chmod -R 644 /etc/cron.d
#ENTRYPOINT ["/bin/bash","-c","service supervisor start"]

View File

@ -1,109 +1,7 @@
# syntax = edrevo/dockerfile-plus
FROM dimti/workspace:7.4 FROM dimti/workspace:7.4
ARG PHP_VERSION=7.4 ARG PHP_VERSION=7.4
ENV PHP_VERSION ${PHP_VERSION}
########################################################################### INCLUDE+ ./workspace.base.Dockerfile
# Laradock non-root user:
###########################################################################
ARG CUSTOM_PUID=1000
ENV PUID ${CUSTOM_PUID}
ARG CUSTOM_PGID=1000
ENV PGID ${CUSTOM_PGID}
RUN usermod -u ${CUSTOM_PUID} laradock && groupmod -g ${CUSTOM_PGID} laradock
RUN chown -R ${CUSTOM_PUID}:${CUSTOM_PGID} /home/laradock
###########################################################################
# Set Timezone
###########################################################################
ARG CUSTOM_TZ=Europe/Moscow
ENV TZ ${CUSTOM_TZ}
RUN ln -snf /usr/share/zoneinfo/$CUSTOM_TZ /etc/localtime && echo $CUSTOM_TZ > /etc/timezone
###########################################################################
# Additional PHP-extensions:
###########################################################################
#RUN pecl install igbinary && pecl install -a redis
RUN pecl install -a redis
RUN echo "extension=redis.so" > /etc/php/${PHP_VERSION}/cli/conf.d/20-redis.ini
###########################################################################
# S3 config
###########################################################################
USER laradock
COPY ./minio/auth.json /home/laradock/.mc/config.json
###########################################################################
# Install custom node version
###########################################################################
USER root
ARG NODE_VERSION
ENV NODE_VERSION ${NODE_VERSION}
RUN if [ ! -z "${NODE_VERSION}" ]; then \
. ~/.bashrc && nvm install ${NODE_VERSION} \
&& . ~/.bashrc && nvm alias default ${NODE_VERSION} \
&& npm i -g yarn \
&& cp -R ~/.nvm/alias /home/laradock/.nvm \
&& cp -R ~/.nvm/versions /home/laradock/.nvm \
&& chown -R ${CUSTOM_PUID}:${CUSTOM_PGID} /home/laradock/.nvm \
;fi
###########################################################################
# Update composer version
###########################################################################
USER root
ARG COMPOSER_VERSION=1
ENV COMPOSER_VERSION ${COMPOSER_VERSION}
RUN composer self-update # Need for correctly update to actual old branch
RUN composer self-update --${COMPOSER_VERSION}
###########################################################################
# Laradock Aliases
###########################################################################
USER laradock
COPY ./aliases.sh /home/laradock/aliases.sh
RUN echo "" >> ~/.bashrc && \
echo "# Load Custom Aliases" >> ~/.bashrc && \
echo "source ~/aliases.sh" >> ~/.bashrc && \
echo "" >> ~/.bashrc
###########################################################################
# Tune opts:
###########################################################################
USER root
ARG PHP_OPT_SHORT_OPEN_TAG=Off
RUN sed -i "s/^short_open_tag = .*/short_open_tag = $PHP_OPT_SHORT_OPEN_TAG/g" /etc/php/${PHP_VERSION}/cli/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" /etc/php/${PHP_VERSION}/cli/php.ini
ARG PHP_OPT_MEMORY_LIMIT=256M
RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" /etc/php/${PHP_VERSION}/cli/php.ini
###########################################################################
# Crontab
###########################################################################
USER root
COPY ./crontab /etc/cron.d
RUN chmod -R 644 /etc/cron.d

View File

@ -1,108 +1,7 @@
# syntax = edrevo/dockerfile-plus
FROM dimti/workspace:8.1 FROM dimti/workspace:8.1
ARG PHP_VERSION=8.1 ARG PHP_VERSION=8.1
ENV PHP_VERSION ${PHP_VERSION}
########################################################################### INCLUDE+ ./workspace.base.Dockerfile
# Laradock non-root user:
###########################################################################
ARG CUSTOM_PUID=1000
ENV PUID ${CUSTOM_PUID}
ARG CUSTOM_PGID=1000
ENV PGID ${CUSTOM_PGID}
RUN usermod -u ${CUSTOM_PUID} laradock && groupmod -g ${CUSTOM_PGID} laradock
RUN chown -R ${CUSTOM_PUID}:${CUSTOM_PGID} /home/laradock
###########################################################################
# Set Timezone
###########################################################################
ARG CUSTOM_TZ=Europe/Moscow
ENV TZ ${CUSTOM_TZ}
RUN ln -snf /usr/share/zoneinfo/$CUSTOM_TZ /etc/localtime && echo $CUSTOM_TZ > /etc/timezone
###########################################################################
# Additional PHP-extensions:
###########################################################################
#RUN pecl install igbinary && pecl install -a redis
RUN pecl install -a redis
RUN echo "extension=redis.so" > /etc/php/${PHP_VERSION}/cli/conf.d/20-redis.ini
###########################################################################
# S3 config
###########################################################################
USER laradock
COPY ./minio/auth.json /home/laradock/.mc/config.json
###########################################################################
# Install custom node version
###########################################################################
USER root
ARG NODE_VERSION
ENV NODE_VERSION ${NODE_VERSION}
RUN if [ ! -z "${NODE_VERSION}" ]; then \
. ~/.bashrc && nvm install ${NODE_VERSION} \
&& . ~/.bashrc && nvm alias default ${NODE_VERSION} \
&& npm i -g yarn \
&& cp -R ~/.nvm/alias /home/laradock/.nvm \
&& cp -R ~/.nvm/versions /home/laradock/.nvm \
&& chown -R ${CUSTOM_PUID}:${CUSTOM_PGID} /home/laradock/.nvm \
;fi
###########################################################################
# Update composer version
###########################################################################
USER root
ARG COMPOSER_VERSION=2
ENV COMPOSER_VERSION ${COMPOSER_VERSION}
RUN composer self-update --${COMPOSER_VERSION}
###########################################################################
# Laradock Aliases
###########################################################################
USER laradock
COPY ./aliases.sh /home/laradock/aliases.sh
RUN echo "" >> ~/.bashrc && \
echo "# Load Custom Aliases" >> ~/.bashrc && \
echo "source ~/aliases.sh" >> ~/.bashrc && \
echo "" >> ~/.bashrc
###########################################################################
# Tune opts:
###########################################################################
USER root
ARG PHP_OPT_SHORT_OPEN_TAG=Off
RUN sed -i "s/^short_open_tag = .*/short_open_tag = $PHP_OPT_SHORT_OPEN_TAG/g" /etc/php/${PHP_VERSION}/cli/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" /etc/php/${PHP_VERSION}/cli/php.ini
ARG PHP_OPT_MEMORY_LIMIT=256M
RUN sed -i "s/^memory_limit = .*/memory_limit = $PHP_OPT_MEMORY_LIMIT/g" /etc/php/${PHP_VERSION}/cli/php.ini
###########################################################################
# Crontab
###########################################################################
USER root
COPY ./crontab /etc/cron.d
RUN chmod -R 644 /etc/cron.d

View File

@ -0,0 +1,7 @@
# syntax = edrevo/dockerfile-plus
FROM dimti/workspace:8.2
ARG PHP_VERSION=8.2
ENV PHP_VERSION ${PHP_VERSION}
INCLUDE+ ./workspace.base.Dockerfile

View File

@ -0,0 +1,7 @@
# syntax = edrevo/dockerfile-plus
FROM dimti/workspace:8.3
ARG PHP_VERSION=8.3
ENV PHP_VERSION ${PHP_VERSION}
INCLUDE+ ./workspace.base.Dockerfile

View File

@ -1,73 +0,0 @@
#! /bin/bash
# NOTE: At the moment, this has only been confirmed to work with PHP 7
PHP_VERSION=$2 # Without dot
WITH_PROFILER=$3
# Grab full name of workspace container
WORKSPACE_CONTAINER=$(docker ps | grep workspace${PHP_VERSION} | awk '{print $1}')
if [[ -z "${WORKSPACE_CONTAINER}" ]]; then
echo "Unable to find workspace container: workspace${PHP_VERSION}"
exit 1
fi
if [[ ! -z "${WITH_PROFILER}" ]]; then
echo "With profiler option".
fi
xdebug_status ()
{
echo 'xDebug status'
docker exec -it $WORKSPACE_CONTAINER bash -c 'php -v'
}
xdebug_start ()
{
echo 'Start xDebug'
# And uncomment line with xdebug extension, thus enabling it
ON_CMD='sed -i "s/^;zend_extension=/zend_extension=/g" /etc/php/$PHP_VERSION/cli/conf.d/20-xdebug.ini'
docker exec -it $WORKSPACE_CONTAINER bash -c "${ON_CMD}"
docker exec -it $WORKSPACE_CONTAINER bash -c 'php -v'
echo 'In cli use this for resolve hostname for debugger in your IDE:'
echo 'export PHP_IDE_CONFIG="serverName=loc.mydomain.ru"'
}
xdebug_stop ()
{
echo 'Stop xDebug'
# Comment out xdebug extension line
OFF_CMD='sed -i "s/^zend_extension=/;zend_extension=/g" /etc/php/$PHP_VERSION/cli/conf.d/20-xdebug.ini'
docker exec -it $WORKSPACE_CONTAINER bash -c "${OFF_CMD}"
docker exec -it $WORKSPACE_CONTAINER bash -c 'php -v'
}
case $1 in
stop|STOP)
xdebug_stop
;;
start|START)
xdebug_start
;;
status|STATUS)
xdebug_status
;;
*)
echo "xDebug [Stop | Start | Status] in the ${WORKSPACE_CONTAINER} container."
echo "xDebug must have already been installed."
echo "Usage:"
echo " .php-fpm/xdebug stop|start|status"
esac
exit 1

1
quick/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
/_*.sh

View File

@ -0,0 +1 @@
PHP_VERSIONS=(74 81 82 83)

17
quick/pull-php-src.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
. $SCRIPT_DIR/_settings.sh || {
echo "no settings" && exit 1
}
function dot_version() {
sed -r 's/^([[:digit:]])/\1./g' <<< $1
}
for PHP_VERSION in "${PHP_VERSIONS[@]}"; do
PHP_IMAGE=$(dot_version ${PHP_VERSION})
docker pull "dimti/workspace:${PHP_IMAGE}"
docker pull "dimti/php:${PHP_IMAGE}"
done

27
quick/rebuild-php.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/bash
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
. $SCRIPT_DIR/_settings.sh || {
echo "no settings" && exit 1
}
cd "$SCRIPT_DIR/.."
set -e
for PHP_VERSION in "${PHP_VERSIONS[@]}"; do
echo
echo "Rebuilding: PHP ${PHP_VERSION}"
echo
PHP_SERVICE="php${PHP_VERSION}"
WORKSPACE_SERVICE="workspace${PHP_VERSION}"
bash -ic "dc build ${PHP_SERVICE}"
bash -ic "dc up -d --force-recreate ${PHP_SERVICE}"
bash -ic "dc build ${WORKSPACE_SERVICE}"
bash -ic "dc up -d --force-recreate ${WORKSPACE_SERVICE}"
echo
done

View File

@ -1,33 +1,26 @@
### PHP COMMON #############################################
INSTALL_XDEBUG==true
INSTALL_OPCACHE=true
INSTALL_REDIS=true
### WORKSPACE ############################################# ### WORKSPACE #############################################
WORKSPACE_PUID=1000 # Workspace based on Ubuntu: https://github.com/phusion/baseimage-docker/blob/master/image/Dockerfile
WORKSPACE_PGID=1000 # Ubuntu release: https://releases.ubuntu.com
WORKSPACE_TIMEZONE=Europe/Moscow
WORKSPACE_INSTALL_SSH=true # PHP-extensions already installed: PDO (COMMON), INTL, MYSQL, PGSQL, ZIP, BCMATH etcetera
WORKSPACE_INSTALL_MYSQL_CLIENT=true # See https://github.com/laradock/workspace/blob/master/Dockerfile-8.2
WORKSPACE_INSTALL_FSWATCH=false # php-common modules: https://packages.debian.org/sid/i386/php8.2-common/filelist
WORKSPACE_INSTALL_PING=true # opcache module installed automatic (not from php-common, but from php by default) and not needed for cli)
WORKSPACE_INSTALL_S3_MINIO_CLIENT=true
WORKSPACE_INSTALL_BZ2=true
# PHP-extensions already installed: INTL, PGSQL, BCMATH
WORKSPACE_INSTALL_WP_CLI=true WORKSPACE_INSTALL_WP_CLI=true
WORKSPACE_INSTALL_NODE=true WORKSPACE_INSTALL_NVM=true
WORKSPACE_INSTALL_GULP=true
WORKSPACE_INSTALL_YARN=true
WORKSPACE_NODE_VERSION=lts/hydrogen
WORKSPACE_NPM_REGISTRY=
WORKSPACE_YARN_VERSION=latest
### PHP-FPM ############################################# ### PHP-FPM #############################################
INSTALL_XDEBUG=true # PHP-FPM based on Debian: https://github.com/devilbox/docker-php-fpm-8.2/blob/master/Dockerfiles/Dockerfile
INSTALL_REDIS=true # Debian releases: https://www.debian.org/releases/
INSTALL_ZIP=true
INSTALL_BZ2=true
INSTALL_OPCACHE=true
INSTALL_INTL=true
INSTALL_PGSQL=true
INSTALL_BCMATH=true
PHP_OPT_MAX_EXECUTION_TIME=600 PHP_OPT_MAX_EXECUTION_TIME=600
PHP_OPT_MEMORY_LIMIT=256M PHP_OPT_MEMORY_LIMIT=256M
PHP_OPT_POST_MAX_SIZE=48M PHP_OPT_POST_MAX_SIZE=200M
PHP_OPT_UPLOAD_MAX_FILESIZE=16M PHP_OPT_UPLOAD_MAX_FILESIZE=90M

View File

@ -1,36 +1,14 @@
version: '3.6'
services: services:
php-fpm: php-fpm:
build: build:
context: ./dockerfiles/php-fpm context: ./dockerfiles/php
args: args:
- INSTALL_XDEBUG=${INSTALL_XDEBUG}
- INSTALL_ZIP=${INSTALL_ZIP}
- INSTALL_BZ2=${INSTALL_BZ2}
- INSTALL_OPCACHE=${INSTALL_OPCACHE}
- INSTALL_INTL=${INSTALL_INTL}
- INSTALL_PGSQL=${INSTALL_PGSQL}
- INSTALL_BCMATH=${INSTALL_BCMATH}
- PHP_OPT_MAX_EXECUTION_TIME=${PHP_OPT_MAX_EXECUTION_TIME} - PHP_OPT_MAX_EXECUTION_TIME=${PHP_OPT_MAX_EXECUTION_TIME}
- PHP_OPT_MEMORY_LIMIT=${PHP_OPT_MEMORY_LIMIT} - PHP_OPT_MEMORY_LIMIT=${PHP_OPT_MEMORY_LIMIT}
- PHP_OPT_POST_MAX_SIZE=${PHP_OPT_POST_MAX_SIZE} - PHP_OPT_POST_MAX_SIZE=${PHP_OPT_POST_MAX_SIZE}
- PHP_OPT_UPLOAD_MAX_FILESIZE=${PHP_OPT_UPLOAD_MAX_FILESIZE} - PHP_OPT_UPLOAD_MAX_FILESIZE=${PHP_OPT_UPLOAD_MAX_FILESIZE}
workspace: workspace:
build: build:
context: ./dockerfiles/workspace context: ./dockerfiles/php
args: args:
- PUID=${WORKSPACE_PUID}
- PGID=${WORKSPACE_PGID}
- TZ=${WORKSPACE_TIMEZONE}
- INSTALL_SSH=${WORKSPACE_INSTALL_SSH}
- INSTALL_MYSQL_CLIENT=${WORKSPACE_INSTALL_MYSQL_CLIENT}
- INSTALL_FSWATCH=${WORKSPACE_INSTALL_FSWATCH}
- INSTALL_PING=${WORKSPACE_INSTALL_PING}
- INSTALL_S3_MINIO_CLIENT=${WORKSPACE_INSTALL_S3_MINIO_CLIENT}
- INSTALL_BZ2=${WORKSPACE_INSTALL_BZ2}
- INSTALL_WP_CLI=${WORKSPACE_INSTALL_WP_CLI}
- PHP_OPT_MAX_EXECUTION_TIME=${PHP_OPT_MAX_EXECUTION_TIME}
- PHP_OPT_MEMORY_LIMIT=${PHP_OPT_MEMORY_LIMIT} - 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}

View File

@ -1,33 +1,49 @@
version: '3.6'
services: services:
php56:
extends:
file: docker-compose.base.yml
service: php-fpm
build:
dockerfile: php56.Dockerfile
php74: php74:
extends: extends:
file: docker-compose.base.yml file: docker-compose.base.yml
service: php-fpm service: php-fpm
build: build:
dockerfile: php74.Dockerfile dockerfile: fpm/php74.Dockerfile
php81: php81:
extends: extends:
file: docker-compose.base.yml file: docker-compose.base.yml
service: php-fpm service: php-fpm
build: build:
dockerfile: php81.Dockerfile dockerfile: fpm/php81.Dockerfile
php82:
extends:
file: docker-compose.base.yml
service: php-fpm
build:
dockerfile: fpm/php82.Dockerfile
php83:
extends:
file: docker-compose.base.yml
service: php-fpm
build:
dockerfile: fpm/php83.Dockerfile
workspace74: workspace74:
extends: extends:
file: docker-compose.base.yml file: docker-compose.base.yml
service: workspace service: workspace
build: build:
dockerfile: workspace74.Dockerfile dockerfile: workspace/workspace74.Dockerfile
workspace81: workspace81:
extends: extends:
file: docker-compose.base.yml file: docker-compose.base.yml
service: workspace service: workspace
build: build:
dockerfile: workspace81.Dockerfile dockerfile: workspace/workspace81.Dockerfile
workspace82:
extends:
file: docker-compose.base.yml
service: workspace
build:
dockerfile: workspace/workspace82.Dockerfile
workspace83:
extends:
file: docker-compose.base.yml
service: workspace
build:
dockerfile: workspace/workspace83.Dockerfile

View File

@ -1,139 +0,0 @@
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-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; \
elif [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
pecl install xdebug-3.1.6; \
else \
pecl install xdebug-2.9.8; \
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
###########################################################################
# 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
###########################################################################
# BZ2:
###########################################################################
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
###########################################################################
# OPCACHE:
###########################################################################
ARG INSTALL_OPCACHE=false
RUN if [ ${INSTALL_OPCACHE} = true ]; then \
docker-php-ext-install opcache \
&& docker-php-ext-enable opcache \
;fi
###########################################################################
# INTL:
###########################################################################
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
###########################################################################
# PGSQL:
###########################################################################
ARG INSTALL_PGSQL=false
RUN if [ ${INSTALL_PGSQL} = true ]; then \
apt update && apt install -y libpq-dev \
&& docker-php-ext-install pgsql \
&& docker-php-ext-install pdo_pgsql \
;fi
###########################################################################
# BCMATH:
###########################################################################
ARG INSTALL_BCMATH=false
RUN if [ ${INSTALL_BCMATH} = true ]; then \
docker-php-ext-install bcmath \
;fi
###########################################################################
# Locales:
###########################################################################
RUN apt --allow-releaseinfo-change update && \
apt install -y locales && \
sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
###########################################################################
# 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"
###########################################################################
# 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"
###########################################################################
# Tune opts:
###########################################################################
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_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=48M
RUN sed -i "s/^post_max_size = .*/post_max_size = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_UPLOAD_MAX_FILESIZE=16M
RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini"

View File

@ -1,136 +0,0 @@
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-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-2.9.8; \
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
###########################################################################
# 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
###########################################################################
# BZ2:
###########################################################################
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
###########################################################################
# OPCACHE:
###########################################################################
ARG INSTALL_OPCACHE=false
RUN if [ ${INSTALL_OPCACHE} = true ]; then \
docker-php-ext-install opcache \
&& docker-php-ext-enable opcache \
;fi
###########################################################################
# INTL:
###########################################################################
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
###########################################################################
# PGSQL:
###########################################################################
ARG INSTALL_PGSQL=false
RUN if [ ${INSTALL_PGSQL} = true ]; then \
apt update && apt install -y libpq-dev \
&& docker-php-ext-install pgsql \
&& docker-php-ext-install pdo_pgsql \
;fi
###########################################################################
# BCMATH:
###########################################################################
ARG INSTALL_BCMATH=false
RUN if [ ${INSTALL_BCMATH} = true ]; then \
docker-php-ext-install bcmath \
;fi
###########################################################################
# Locales:
###########################################################################
RUN apt install -y locales && \
sed -i 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen && \
sed -i 's/# ru_RU.UTF-8 UTF-8/ru_RU.UTF-8 UTF-8/' /etc/locale.gen && \
locale-gen
###########################################################################
# 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"
###########################################################################
# 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"
###########################################################################
# Tune opts:
###########################################################################
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_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=48M
RUN sed -i "s/^post_max_size = .*/post_max_size = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini"
ARG PHP_OPT_UPLOAD_MAX_FILESIZE=16M
RUN sed -i "s/^upload_max_filesize = .*/upload_max_filesize = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" "$PHP_INI_DIR/php.ini"

View File

@ -1,7 +0,0 @@
# syntax = edrevo/dockerfile-plus
FROM php:5.6-fpm
INCLUDE+ ./php.base56.Dockerfile
RUN 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

View File

@ -1,7 +0,0 @@
# syntax = edrevo/dockerfile-plus
FROM php:7.4-fpm
INCLUDE+ ./php.base.Dockerfile
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install -j$(nproc) gd

View File

@ -1,7 +0,0 @@
# syntax = edrevo/dockerfile-plus
FROM php:8.1-fpm
INCLUDE+ ./php.base.Dockerfile
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \
&& docker-php-ext-install -j$(nproc) gd

View File

@ -0,0 +1,117 @@
ARG DEBIAN_FRONTEND=noninteractive
ARG DEBCONF_NOWARNINGS=yes
# locales ~ 20 Mb
# libicu-dev ~ 50 Mb
# libpq-dev ~ 14 Mb
# libzip-dev ~ 2 Mb
# libbz2-dev ~ 1 Mb
# libfreetype6-dev ~ 6 Mb
# libpng-dev ~ 3 Mb
# libwebp-dev ~ 2 Mb
# libjpeg62-turbo-dev ~ 2 Mb
# apt install does not support -qq options and not to be quited long starter message with accumulative info about installed packages
# also apt upgrade and apt install with -qq option non propose automatic -y option, instead of apt-get install or apt-get upgrade
# But apt update is supporting -qq options for quiting output
RUN apt -qq update && \
apt-get install locales libicu-dev libpq-dev libzip-dev libbz2-dev \
libfreetype6-dev libpng-dev libwebp-dev libjpeg62-turbo-dev -qq
# For php7.4-fpm image - need to be upgraded apt packages
RUN if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ]; then \
apt-get -qq upgrade \
;fi
###########################################################################
# Locale:
###########################################################################
RUN locale-gen en_US.UTF-8
###########################################################################
# Install PHP-extensions:
###########################################################################
RUN docker-php-ext-install -j$(nproc) iconv
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp && \
docker-php-ext-install -j$(nproc) gd
# opcache already installed and only need enable to
RUN docker-php-ext-enable opcache
# some extension already loaded by default (of course if or after is installed)
ARG EXTENSIONS='pdo intl mysqli pgsql zip bcmath bz2 pdo_mysql pdo_pgsql'
# Extension automatic enable in helper install script
# See: https://github.com/devilbox/docker-php-fpm-7.4/blob/master/data/docker-php-ext-install#L111
RUN docker-php-ext-install ${EXTENSIONS}
###########################################################################
# xDebug:
###########################################################################
# For PHP 7.4 xdebug 3.1 also is supported, but staty xdebug 2 version for compatibility experiences
# See https://xdebug.org/docs/compat
# And see exactly xdebug minor versions: https://pecl.php.net/package/xdebug
RUN PHP_MAJOR_VERSION=$(php -r 'echo PHP_MAJOR_VERSION;') && \
PHP_MINOR_VERSION=$(php -r 'echo PHP_MINOR_VERSION;') && \
if [ $PHP_MAJOR_VERSION = '8' ]; then \
pecl install xdebug-3.4.1; \
elif [ $PHP_MAJOR_VERSION = '7' ]; then \
pecl install xdebug-2.9.8; \
else \
echo "Not support that major PHP version: $PHP_MAJOR_VERSION"; \
exit 1; \
fi && \
docker-php-ext-enable xdebug && \
sed -i 's/^zend_extension=/;zend_extension=/g' "$PHP_INI_DIR/conf.d/docker-php-ext-xdebug.ini"
###########################################################################
# Redis:
###########################################################################
RUN echo '' | pecl install redis && \
docker-php-ext-enable redis
###########################################################################
# 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"
###########################################################################
# 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"
###########################################################################
# Tune opts:
###########################################################################
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_UPLOAD_MAX_FILESIZE/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"
#
#--------------------------------------------------------------------------
# Final Touch
#--------------------------------------------------------------------------
#
# Clean up
RUN apt clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
rm /var/log/lastlog /var/log/faillog

View File

@ -0,0 +1,19 @@
# syntax = edrevo/dockerfile-plus
FROM php:7.4-fpm
INCLUDE+ ./fpm/php.base.Dockerfile
ARG XDEBUG_INI_PATH=/usr/local/etc/php/conf.d/xdebug.ini
COPY ./xdebug2.ini ${XDEBUG_INI_PATH}
###########################################################################
# Remove DST_Root_CA3
###########################################################################
# mozilla\/DST_Root_CA_X3.crt still exists in php-fpm container up to 7.4. On ~8.1 it was removed
RUN sed -i 's/^mozilla\/DST_Root_CA_X3\.crt/!mozilla\/DST_Root_CA_X3.crt/g' /etc/ca-certificates.conf && \
update-ca-certificates

View File

@ -0,0 +1,9 @@
# syntax = edrevo/dockerfile-plus
# Original image: https://github.com/docker-library/php/blob/52062af5056d0cd91fa5ded64fad8f9c82847b49/8.1/bookworm/fpm/Dockerfile
FROM php:8.1-fpm
INCLUDE+ ./fpm/php.base.Dockerfile
ARG XDEBUG_INI_PATH=/usr/local/etc/php/conf.d/xdebug.ini
COPY ./xdebug3.ini ${XDEBUG_INI_PATH}

Some files were not shown because too many files have changed in this diff Show More