add docker version
This commit is contained in:
283
docker/.env
Normal file
283
docker/.env
Normal file
@@ -0,0 +1,283 @@
|
|||||||
|
###########################################################
|
||||||
|
###################### General Setup ######################
|
||||||
|
###########################################################
|
||||||
|
|
||||||
|
PUID=1000
|
||||||
|
PGID=1000
|
||||||
|
TIMEZONE=Europe/Paris
|
||||||
|
|
||||||
|
### Paths #################################################
|
||||||
|
|
||||||
|
# Point to the path of your applications code on your host
|
||||||
|
APP_CODE_PATH_HOST=../
|
||||||
|
|
||||||
|
# Point to where the `APP_CODE_PATH_HOST` should be in the container
|
||||||
|
APP_CODE_PATH_CONTAINER=/var/www
|
||||||
|
|
||||||
|
# You may add flags to the path `:cached`, `:delegated`. When using Docker Sync add `:nocopy`
|
||||||
|
APP_CODE_CONTAINER_FLAG=:cached
|
||||||
|
|
||||||
|
# Choose storage path on your machine. For all storage systems
|
||||||
|
DATA_PATH_HOST=../data/
|
||||||
|
|
||||||
|
### Drivers ################################################
|
||||||
|
|
||||||
|
# All volumes driver
|
||||||
|
VOLUMES_DRIVER=local
|
||||||
|
|
||||||
|
# All Networks driver
|
||||||
|
NETWORKS_DRIVER=bridge
|
||||||
|
|
||||||
|
### Docker compose files ##################################
|
||||||
|
|
||||||
|
# Select which docker-compose files to include. If using docker-sync append `:docker-compose.sync.yml` at the end
|
||||||
|
COMPOSE_FILE=docker-compose.yml
|
||||||
|
|
||||||
|
# Change the separator from : to ; on Windows
|
||||||
|
COMPOSE_PATH_SEPARATOR=:
|
||||||
|
|
||||||
|
# Define the prefix of container names. This is useful if you have multiple projects that use laradock to have separate containers per project.
|
||||||
|
COMPOSE_PROJECT_NAME=opensem
|
||||||
|
|
||||||
|
### PHP Version ###########################################
|
||||||
|
|
||||||
|
# Select a PHP version of the Workspace and PHP-FPM containers (Does not apply to HHVM).
|
||||||
|
# Accepted values: 8.0 - 7.4 - 7.3 - 7.2 - 7.1 - 7.0 - 5.6
|
||||||
|
PHP_VERSION=8.1
|
||||||
|
|
||||||
|
### PHP Interpreter #######################################
|
||||||
|
|
||||||
|
# Select the PHP Interpreter. Accepted values: hhvm - php-fpm
|
||||||
|
PHP_INTERPRETER=php-fpm
|
||||||
|
|
||||||
|
### Docker Host IP ########################################
|
||||||
|
|
||||||
|
# Enter your Docker Host IP (will be appended to /etc/hosts). Default is `10.0.75.1`
|
||||||
|
DOCKER_HOST_IP=10.0.75.1
|
||||||
|
|
||||||
|
### Remote Interpreter ####################################
|
||||||
|
|
||||||
|
# Choose a Remote Interpreter entry matching name. Default is `laradock`
|
||||||
|
PHP_IDE_CONFIG=serverName=opensem
|
||||||
|
|
||||||
|
### PHP DOWNGRADEOPENSSL TLS AND SECLEVEL #################
|
||||||
|
|
||||||
|
PHP_DOWNGRADE_OPENSSL_TLS_AND_SECLEVEL=false
|
||||||
|
|
||||||
|
### Windows Path ##########################################
|
||||||
|
|
||||||
|
# A fix for Windows users, to ensure the application path works
|
||||||
|
COMPOSE_CONVERT_WINDOWS_PATHS=1
|
||||||
|
|
||||||
|
### Environment ###########################################
|
||||||
|
|
||||||
|
# If you need to change the sources (i.e. to China), set CHANGE_SOURCE to true
|
||||||
|
CHANGE_SOURCE=false
|
||||||
|
# Set CHANGE_SOURCE and UBUNTU_SOURCE option if you want to change the Ubuntu system sources.list file.
|
||||||
|
UBUNTU_SOURCE=aliyun
|
||||||
|
# Set ORACLE INSTANT_CLIENT_MIRROR option if you want to use Intranet improve download, you can download files first
|
||||||
|
ORACLE_INSTANT_CLIENT_MIRROR=https://github.com/diogomascarenha/oracle-instantclient/raw/master/
|
||||||
|
|
||||||
|
### Docker Sync ###########################################
|
||||||
|
|
||||||
|
# If you are using Docker Sync. For `osx` use 'native_osx', for `windows` use 'unison', for `linux` docker-sync is not required
|
||||||
|
DOCKER_SYNC_STRATEGY=unison
|
||||||
|
|
||||||
|
### Install Oh My ZSH! ####################################
|
||||||
|
|
||||||
|
# If you want to use "Oh My ZSH!" with Laravel autocomplete plugin, set SHELL_OH_MY_ZSH to true.
|
||||||
|
|
||||||
|
SHELL_OH_MY_ZSH=false
|
||||||
|
SHELL_OH_MY_ZSH_AUTOSUGESTIONS=false
|
||||||
|
SHELL_OH_MY_ZSH_ALIASES=false
|
||||||
|
|
||||||
|
###########################################################
|
||||||
|
################ Containers Customization #################
|
||||||
|
###########################################################
|
||||||
|
|
||||||
|
### WORKSPACE #############################################
|
||||||
|
|
||||||
|
WORKSPACE_BASE_IMAGE_TAG_PREFIX=latest
|
||||||
|
WORKSPACE_COMPOSER_GLOBAL_INSTALL=true
|
||||||
|
WORKSPACE_COMPOSER_VERSION=2
|
||||||
|
WORKSPACE_COMPOSER_AUTH=false
|
||||||
|
WORKSPACE_COMPOSER_REPO_PACKAGIST=
|
||||||
|
WORKSPACE_NVM_NODEJS_ORG_MIRROR=
|
||||||
|
WORKSPACE_INSTALL_NODE=true
|
||||||
|
WORKSPACE_NODE_VERSION=node
|
||||||
|
WORKSPACE_NPM_REGISTRY=
|
||||||
|
WORKSPACE_NPM_FETCH_RETRIES=2
|
||||||
|
WORKSPACE_NPM_FETCH_RETRY_FACTOR=10
|
||||||
|
WORKSPACE_NPM_FETCH_RETRY_MINTIMEOUT=10000
|
||||||
|
WORKSPACE_NPM_FETCH_RETRY_MAXTIMEOUT=60000
|
||||||
|
WORKSPACE_INSTALL_PNPM=false
|
||||||
|
WORKSPACE_INSTALL_YARN=true
|
||||||
|
WORKSPACE_YARN_VERSION=latest
|
||||||
|
WORKSPACE_INSTALL_PHPREDIS=true
|
||||||
|
WORKSPACE_INSTALL_WORKSPACE_SSH=false
|
||||||
|
WORKSPACE_INSTALL_BZ2=false
|
||||||
|
WORKSPACE_INSTALL_GMP=false
|
||||||
|
WORKSPACE_INSTALL_SSH2=false
|
||||||
|
WORKSPACE_INSTALL_LDAP=false
|
||||||
|
WORKSPACE_INSTALL_SMB=false
|
||||||
|
WORKSPACE_INSTALL_IMAP=false
|
||||||
|
WORKSPACE_INSTALL_SUPERVISOR=false
|
||||||
|
WORKSPACE_INSTALL_IMAGE_OPTIMIZERS=true
|
||||||
|
WORKSPACE_INSTALL_IMAGEMAGICK=true
|
||||||
|
WORKSPACE_IMAGEMAGICK_VERSION=latest
|
||||||
|
WORKSPACE_INSTALL_DUSK_DEPS=false
|
||||||
|
WORKSPACE_INSTALL_LIBPNG=true
|
||||||
|
WORKSPACE_INSTALL_MYSQL_CLIENT=true
|
||||||
|
WORKSPACE_INSTALL_PING=false
|
||||||
|
WORKSPACE_INSTALL_SSHPASS=false
|
||||||
|
WORKSPACE_INSTALL_YAML=true
|
||||||
|
WORKSPACE_INSTALL_MAILPARSE=false
|
||||||
|
WORKSPACE_INSTALL_XMLRPC=false
|
||||||
|
WORKSPACE_PUID=1000
|
||||||
|
WORKSPACE_PGID=1000
|
||||||
|
WORKSPACE_CHROME_DRIVER_VERSION=2.42
|
||||||
|
WORKSPACE_TIMEZONE=Europe/Paris
|
||||||
|
WORKSPACE_SSH_PORT=2222
|
||||||
|
WORKSPACE_INSTALL_WKHTMLTOPDF=true
|
||||||
|
WORKSPACE_INSTALL_GIT_PROMPT=false
|
||||||
|
WORKSPACE_INSTALL_DOCKER_CLIENT=false
|
||||||
|
WORKSPACE_INSTALL_MEMCACHED=true
|
||||||
|
|
||||||
|
### PHP_FPM ###############################################
|
||||||
|
|
||||||
|
PHP_FPM_BASE_IMAGE_TAG_PREFIX=latest
|
||||||
|
PHP_FPM_INSTALL_BCMATH=true
|
||||||
|
PHP_FPM_INSTALL_MYSQLI=true
|
||||||
|
PHP_FPM_INSTALL_INTL=true
|
||||||
|
PHP_FPM_INSTALL_IMAGEMAGICK=true
|
||||||
|
PHP_FPM_IMAGEMAGICK_VERSION=latest
|
||||||
|
PHP_FPM_INSTALL_OPCACHE=true
|
||||||
|
PHP_FPM_INSTALL_IMAGE_OPTIMIZERS=true
|
||||||
|
PHP_FPM_INSTALL_PHPREDIS=true
|
||||||
|
PHP_FPM_INSTALL_MEMCACHED=false
|
||||||
|
PHP_FPM_INSTALL_BZ2=false
|
||||||
|
PHP_FPM_INSTALL_ENCHANT=false
|
||||||
|
PHP_FPM_INSTALL_GMP=false
|
||||||
|
PHP_FPM_INSTALL_IMAP=false
|
||||||
|
PHP_FPM_INSTALL_SSH2=false
|
||||||
|
PHP_FPM_INSTALL_SOAP=false
|
||||||
|
PHP_FPM_INSTALL_XSL=true
|
||||||
|
PHP_FPM_INSTALL_EXIF=true
|
||||||
|
PHP_FPM_INSTALL_GHOSTSCRIPT=false
|
||||||
|
PHP_FPM_INSTALL_LDAP=false
|
||||||
|
PHP_FPM_INSTALL_PCNTL=false
|
||||||
|
PHP_FPM_INSTALL_CALENDAR=false
|
||||||
|
PHP_FPM_INSTALL_FAKETIME=false
|
||||||
|
PHP_FPM_INSTALL_GETTEXT=false
|
||||||
|
PHP_FPM_INSTALL_XMLRPC=false
|
||||||
|
PHP_FPM_FAKETIME=-0
|
||||||
|
PHP_FPM_INSTALL_APCU=true
|
||||||
|
PHP_FPM_INSTALL_CACHETOOL=false
|
||||||
|
PHP_FPM_INSTALL_YAML=true
|
||||||
|
PHP_FPM_INSTALL_ADDITIONAL_LOCALES=true
|
||||||
|
PHP_FPM_INSTALL_MYSQL_CLIENT=false
|
||||||
|
PHP_FPM_INSTALL_PING=false
|
||||||
|
PHP_FPM_INSTALL_SSHPASS=false
|
||||||
|
PHP_FPM_INSTALL_MAILPARSE=false
|
||||||
|
PHP_FPM_INSTALL_WKHTMLTOPDF=true
|
||||||
|
PHP_FPM_ADDITIONAL_LOCALES="en_US.UTF-8 es_ES.UTF-8 fr_FR.UTF-8"
|
||||||
|
PHP_FPM_INSTALL_DOCKER_CLIENT=false
|
||||||
|
PHP_FPM_DEFAULT_LOCALE=POSIX
|
||||||
|
PHP_FPM_XDEBUG_PORT=9003
|
||||||
|
|
||||||
|
PHP_FPM_PUID=1000
|
||||||
|
PHP_FPM_PGID=1000
|
||||||
|
|
||||||
|
### PHP_WORKER ############################################
|
||||||
|
|
||||||
|
PHP_WORKER_INSTALL_BZ2=false
|
||||||
|
PHP_WORKER_INSTALL_GD=true
|
||||||
|
PHP_WORKER_INSTALL_IMAGEMAGICK=true
|
||||||
|
PHP_WORKER_IMAGEMAGICK_VERSION=latest
|
||||||
|
PHP_WORKER_INSTALL_GMP=false
|
||||||
|
PHP_WORKER_INSTALL_BCMATH=false
|
||||||
|
PHP_WORKER_INSTALL_MEMCACHED=false
|
||||||
|
# PHP_WORKER_INSTALL_OCI8 Does not work in php5.6 version
|
||||||
|
PHP_WORKER_INSTALL_ZIP_ARCHIVE=true
|
||||||
|
PHP_WORKER_INSTALL_MYSQL_CLIENT=true
|
||||||
|
PHP_WORKER_INSTALL_AMQP=false
|
||||||
|
PHP_WORKER_INSTALL_GHOSTSCRIPT=true
|
||||||
|
PHP_WORKER_INSTALL_REDIS=true
|
||||||
|
PHP_WORKER_INSTALL_IMAP=false
|
||||||
|
PHP_WORKER_INSTALL_XMLRPC=false
|
||||||
|
|
||||||
|
PHP_WORKER_PUID=1000
|
||||||
|
PHP_WORKER_PGID=1000
|
||||||
|
|
||||||
|
### NGINX #################################################
|
||||||
|
|
||||||
|
NGINX_HOST_HTTP_PORT=1080
|
||||||
|
NGINX_HOST_HTTPS_PORT=1443
|
||||||
|
NGINX_HOST_LOG_PATH=./logs/nginx/
|
||||||
|
NGINX_SITES_PATH=./nginx/sites/
|
||||||
|
NGINX_PHP_UPSTREAM_CONTAINER=php-fpm
|
||||||
|
NGINX_PHP_UPSTREAM_PORT=9000
|
||||||
|
NGINX_SSL_PATH=./nginx/ssl/
|
||||||
|
|
||||||
|
NGINX_PUID=1000
|
||||||
|
NGINX_PGID=1000
|
||||||
|
|
||||||
|
### MYSQL #################################################
|
||||||
|
|
||||||
|
MYSQL_VERSION=latest
|
||||||
|
MYSQL_DATABASE=opensem
|
||||||
|
MYSQL_USER=opensem
|
||||||
|
MYSQL_PASSWORD=J492neGBc
|
||||||
|
MYSQL_PORT=3306
|
||||||
|
MYSQL_ROOT_PASSWORD=&s$ZUH%7s8m2
|
||||||
|
MYSQL_ENTRYPOINT_INITDB=./mysql/docker-entrypoint-initdb.d
|
||||||
|
|
||||||
|
### SMTP #################################################
|
||||||
|
|
||||||
|
SMTP_PORT=25
|
||||||
|
|
||||||
|
### REDIS #################################################
|
||||||
|
|
||||||
|
REDIS_PORT=6379
|
||||||
|
REDIS_PASSWORD=GqpY267Bt4
|
||||||
|
|
||||||
|
### PHP MY ADMIN ##########################################
|
||||||
|
|
||||||
|
# Accepted values: mariadb - mysql
|
||||||
|
|
||||||
|
PMA_DB_ENGINE=mysql
|
||||||
|
|
||||||
|
# Credentials/Port:
|
||||||
|
|
||||||
|
PMA_USER=pma
|
||||||
|
PMA_PASSWORD=WrC38y8R3x
|
||||||
|
PMA_ROOT_PASSWORD=WrC38y8R3x
|
||||||
|
PMA_PORT=8081
|
||||||
|
PMA_MAX_EXECUTION_TIME=600
|
||||||
|
PMA_MEMORY_LIMIT=256M
|
||||||
|
PMA_UPLOAD_LIMIT=2G
|
||||||
|
|
||||||
|
# NODEJS SERVER #############################################
|
||||||
|
|
||||||
|
NODEJS_PUID=1000
|
||||||
|
NODEJS_PGID=1000
|
||||||
|
|
||||||
|
HIGHCHARTS_PORT=7801
|
||||||
|
|
||||||
|
|
||||||
|
PUSHER_APP_KEY=Opensem
|
||||||
|
PUSHER_APP_ID=Opensem
|
||||||
|
PUSHER_APP_SECRET=f24A6atX9Y
|
||||||
|
PUSHER_HOST=boutiquedev.jardinenvie.com
|
||||||
|
PUSHER_PORT=6001
|
||||||
|
PUSHER_SCHEME=http
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Proxy #################################################
|
||||||
|
|
||||||
|
PROXY_HOST_HTTP_PORT=1082
|
||||||
|
PROXY_HOST_HTTPS_PORT=1445
|
||||||
|
PROXY_HOST_LOG_PATH=./logs/proxy/
|
||||||
|
PROXY_SITES_PATH=./nginx/sites/
|
||||||
|
PROXY_SSL_PATH=./nginx/ssl/
|
||||||
403
docker/docker-compose.yml
Normal file
403
docker/docker-compose.yml
Normal file
@@ -0,0 +1,403 @@
|
|||||||
|
version: '3.5'
|
||||||
|
|
||||||
|
networks:
|
||||||
|
frontend:
|
||||||
|
driver: ${NETWORKS_DRIVER}
|
||||||
|
backend:
|
||||||
|
driver: ${NETWORKS_DRIVER}
|
||||||
|
volumes:
|
||||||
|
mysql:
|
||||||
|
driver: ${VOLUMES_DRIVER}
|
||||||
|
redis:
|
||||||
|
driver: ${VOLUMES_DRIVER}
|
||||||
|
smtp:
|
||||||
|
driver: ${VOLUMES_DRIVER}
|
||||||
|
phpmyadmin:
|
||||||
|
driver: ${VOLUMES_DRIVER}
|
||||||
|
docker-in-docker:
|
||||||
|
driver: ${VOLUMES_DRIVER}
|
||||||
|
|
||||||
|
services:
|
||||||
|
### Workspace Utilities ##################################
|
||||||
|
workspace:
|
||||||
|
restart: always
|
||||||
|
build:
|
||||||
|
context: ./workspace
|
||||||
|
args:
|
||||||
|
- LARADOCK_PHP_VERSION=${PHP_VERSION}
|
||||||
|
- PUID=${PUID}
|
||||||
|
- PGID=${PGID}
|
||||||
|
- CHROME_DRIVER_VERSION=${WORKSPACE_CHROME_DRIVER_VERSION}
|
||||||
|
- TZ=${TIMEZONE}
|
||||||
|
- INSTALL_DOCKER_CLIENT=${WORKSPACE_INSTALL_DOCKER_CLIENT}
|
||||||
|
- http_proxy
|
||||||
|
- https_proxy
|
||||||
|
- no_proxy
|
||||||
|
volumes:
|
||||||
|
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG}
|
||||||
|
- ./php-worker/supervisord.d:/etc/supervisord.d
|
||||||
|
extra_hosts:
|
||||||
|
- "dockerhost:${DOCKER_HOST_IP}"
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:${WORKSPACE_SSH_PORT}:22"
|
||||||
|
tty: true
|
||||||
|
environment:
|
||||||
|
- PHP_IDE_CONFIG=${PHP_IDE_CONFIG}
|
||||||
|
- DOCKER_HOST=tcp://docker-in-docker:2376
|
||||||
|
- DOCKER_TLS_VERIFY=1
|
||||||
|
- DOCKER_TLS_CERTDIR=/certs
|
||||||
|
- DOCKER_CERT_PATH=/certs/client
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
links:
|
||||||
|
- docker-in-docker
|
||||||
|
|
||||||
|
### highcharts ###########################################
|
||||||
|
highcharts:
|
||||||
|
restart: always
|
||||||
|
build:
|
||||||
|
context: ./highcharts
|
||||||
|
args:
|
||||||
|
- PUID=${PUID}
|
||||||
|
- PGID=${PGID}
|
||||||
|
- TZ=${TIMEZONE}
|
||||||
|
tty: true
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:${HIGHCHARTS_PORT}:8080"
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
### PHP-FPM ##############################################
|
||||||
|
php-fpm:
|
||||||
|
restart: always
|
||||||
|
build:
|
||||||
|
context: ./php-fpm
|
||||||
|
args:
|
||||||
|
- CHANGE_SOURCE=${CHANGE_SOURCE}
|
||||||
|
- BASE_IMAGE_TAG_PREFIX=${PHP_FPM_BASE_IMAGE_TAG_PREFIX}
|
||||||
|
- LARADOCK_PHP_VERSION=${PHP_VERSION}
|
||||||
|
- INSTALL_BZ2=${PHP_FPM_INSTALL_BZ2}
|
||||||
|
- INSTALL_ENCHANT=${PHP_FPM_INSTALL_ENCHANT}
|
||||||
|
- INSTALL_GMP=${PHP_FPM_INSTALL_GMP}
|
||||||
|
- INSTALL_SSH2=${PHP_FPM_INSTALL_SSH2}
|
||||||
|
- INSTALL_XSL=${PHP_FPM_INSTALL_XSL}
|
||||||
|
- INSTALL_IMAP=${PHP_FPM_INSTALL_IMAP}
|
||||||
|
- INSTALL_BCMATH=${PHP_FPM_INSTALL_BCMATH}
|
||||||
|
- INSTALL_PHPREDIS=${PHP_FPM_INSTALL_PHPREDIS}
|
||||||
|
- INSTALL_MEMCACHED=${PHP_FPM_INSTALL_MEMCACHED}
|
||||||
|
- INSTALL_OPCACHE=${PHP_FPM_INSTALL_OPCACHE}
|
||||||
|
- INSTALL_EXIF=${PHP_FPM_INSTALL_EXIF}
|
||||||
|
- INSTALL_MYSQLI=${PHP_FPM_INSTALL_MYSQLI}
|
||||||
|
- INSTALL_INTL=${PHP_FPM_INSTALL_INTL}
|
||||||
|
- INSTALL_GHOSTSCRIPT=${PHP_FPM_INSTALL_GHOSTSCRIPT}
|
||||||
|
- INSTALL_IMAGE_OPTIMIZERS=${PHP_FPM_INSTALL_IMAGE_OPTIMIZERS}
|
||||||
|
- INSTALL_IMAGEMAGICK=${PHP_FPM_INSTALL_IMAGEMAGICK}
|
||||||
|
- INSTALL_CALENDAR=${PHP_FPM_INSTALL_CALENDAR}
|
||||||
|
- INSTALL_FAKETIME=${PHP_FPM_INSTALL_FAKETIME}
|
||||||
|
- INSTALL_APCU=${PHP_FPM_INSTALL_APCU}
|
||||||
|
- INSTALL_CACHETOOL=${PHP_FPM_INSTALL_CACHETOOL}
|
||||||
|
- INSTALL_YAML=${PHP_FPM_INSTALL_YAML}
|
||||||
|
- INSTALL_GETTEXT=${PHP_FPM_INSTALL_GETTEXT}
|
||||||
|
- INSTALL_ADDITIONAL_LOCALES=${PHP_FPM_INSTALL_ADDITIONAL_LOCALES}
|
||||||
|
- INSTALL_MYSQL_CLIENT=${PHP_FPM_INSTALL_MYSQL_CLIENT}
|
||||||
|
- INSTALL_PING=${PHP_FPM_INSTALL_PING}
|
||||||
|
- INSTALL_SSHPASS=${PHP_FPM_INSTALL_SSHPASS}
|
||||||
|
- INSTALL_MAILPARSE=${PHP_FPM_INSTALL_MAILPARSE}
|
||||||
|
- INSTALL_PCNTL=${PHP_FPM_INSTALL_PCNTL}
|
||||||
|
- ADDITIONAL_LOCALES=${PHP_FPM_ADDITIONAL_LOCALES}
|
||||||
|
- INSTALL_WKHTMLTOPDF=${PHP_FPM_INSTALL_WKHTMLTOPDF}
|
||||||
|
- DOWNGRADE_OPENSSL_TLS_AND_SECLEVEL=${PHP_DOWNGRADE_OPENSSL_TLS_AND_SECLEVEL}
|
||||||
|
- PUID=${PUID}
|
||||||
|
- PGID=${PGID}
|
||||||
|
- TZ=${TIMEZONE}
|
||||||
|
- IMAGEMAGICK_VERSION=${PHP_FPM_IMAGEMAGICK_VERSION}
|
||||||
|
- LOCALE=${PHP_FPM_DEFAULT_LOCALE}
|
||||||
|
- INSTALL_DOCKER_CLIENT=${PHP_FPM_INSTALL_DOCKER_CLIENT}
|
||||||
|
- http_proxy
|
||||||
|
- https_proxy
|
||||||
|
- no_proxy
|
||||||
|
volumes:
|
||||||
|
- ./php-fpm/php${PHP_VERSION}.ini:/usr/local/etc/php/php.ini
|
||||||
|
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG}
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:${PHP_FPM_XDEBUG_PORT}:9003"
|
||||||
|
expose:
|
||||||
|
- "9000"
|
||||||
|
extra_hosts:
|
||||||
|
- "dockerhost:${DOCKER_HOST_IP}"
|
||||||
|
environment:
|
||||||
|
- PHP_IDE_CONFIG=${PHP_IDE_CONFIG}
|
||||||
|
- DOCKER_HOST=tcp://docker-in-docker:2376
|
||||||
|
- DOCKER_TLS_VERIFY=1
|
||||||
|
- DOCKER_TLS_CERTDIR=/certs
|
||||||
|
- DOCKER_CERT_PATH=/certs/client
|
||||||
|
- FAKETIME=${PHP_FPM_FAKETIME}
|
||||||
|
depends_on:
|
||||||
|
- workspace
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
links:
|
||||||
|
- docker-in-docker
|
||||||
|
|
||||||
|
### PHP Worker ############################################
|
||||||
|
php-worker:
|
||||||
|
restart: always
|
||||||
|
build:
|
||||||
|
context: ./php-worker
|
||||||
|
args:
|
||||||
|
- CHANGE_SOURCE=${CHANGE_SOURCE}
|
||||||
|
- LARADOCK_PHP_VERSION=${PHP_VERSION}
|
||||||
|
- INSTALL_BZ2=${PHP_WORKER_INSTALL_BZ2}
|
||||||
|
- INSTALL_GD=${PHP_WORKER_INSTALL_GD}
|
||||||
|
- INSTALL_IMAGEMAGICK=${PHP_WORKER_INSTALL_IMAGEMAGICK}
|
||||||
|
- INSTALL_GMP=${PHP_WORKER_INSTALL_GMP}
|
||||||
|
- INSTALL_BCMATH=${PHP_WORKER_INSTALL_BCMATH}
|
||||||
|
- INSTALL_MEMCACHED=${PHP_WORKER_INSTALL_MEMCACHED}
|
||||||
|
- INSTALL_ZIP_ARCHIVE=${PHP_WORKER_INSTALL_ZIP_ARCHIVE}
|
||||||
|
- INSTALL_MYSQL_CLIENT=${PHP_WORKER_INSTALL_MYSQL_CLIENT}
|
||||||
|
- INSTALL_AMQP=${PHP_WORKER_INSTALL_AMQP}
|
||||||
|
- INSTALL_GHOSTSCRIPT=${PHP_WORKER_INSTALL_GHOSTSCRIPT}
|
||||||
|
- INSTALL_REDIS=${PHP_WORKER_INSTALL_REDIS}
|
||||||
|
- PUID=${PUID}
|
||||||
|
- PGID=${PGID}
|
||||||
|
- TZ=${TIMEZONE}
|
||||||
|
- IMAGEMAGICK_VERSION=${PHP_WORKER_IMAGEMAGICK_VERSION}
|
||||||
|
volumes:
|
||||||
|
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG}
|
||||||
|
- ./php-worker/supervisord.d:/etc/supervisord.d
|
||||||
|
depends_on:
|
||||||
|
- workspace
|
||||||
|
extra_hosts:
|
||||||
|
- "dockerhost:${DOCKER_HOST_IP}"
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
### NGINX Server #########################################
|
||||||
|
nginx:
|
||||||
|
restart: always
|
||||||
|
build:
|
||||||
|
context: ./nginx
|
||||||
|
args:
|
||||||
|
- CHANGE_SOURCE=${CHANGE_SOURCE}
|
||||||
|
- PHP_UPSTREAM_CONTAINER=${NGINX_PHP_UPSTREAM_CONTAINER}
|
||||||
|
- PHP_UPSTREAM_PORT=${NGINX_PHP_UPSTREAM_PORT}
|
||||||
|
- PUID=${PUID}
|
||||||
|
- PGID=${PGID}
|
||||||
|
- TZ=${TIMEZONE}
|
||||||
|
- http_proxy
|
||||||
|
- https_proxy
|
||||||
|
- no_proxy
|
||||||
|
volumes:
|
||||||
|
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG}
|
||||||
|
- ${NGINX_HOST_LOG_PATH}:/var/log/nginx
|
||||||
|
- ${NGINX_SITES_PATH}:/etc/nginx/sites-available
|
||||||
|
- ${NGINX_SSL_PATH}:/etc/nginx/ssl
|
||||||
|
ports:
|
||||||
|
- "${NGINX_HOST_HTTP_PORT}:80"
|
||||||
|
- "${NGINX_HOST_HTTPS_PORT}:443"
|
||||||
|
depends_on:
|
||||||
|
- php-fpm
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
labels:
|
||||||
|
- traefik.port=80
|
||||||
|
- traefik.backend=nginx
|
||||||
|
- traefik.frontend.rule=Host:opensem.docker.localhost
|
||||||
|
- traefik.http.routers.nginx.rule=Host(`opensem².docker.localhost`)
|
||||||
|
|
||||||
|
### MySQL ################################################
|
||||||
|
mysql:
|
||||||
|
restart: always
|
||||||
|
build:
|
||||||
|
context: ./mysql
|
||||||
|
args:
|
||||||
|
- MYSQL_VERSION=${MYSQL_VERSION}
|
||||||
|
environment:
|
||||||
|
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
||||||
|
- MYSQL_USER=${MYSQL_USER}
|
||||||
|
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||||
|
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
||||||
|
- TZ=${TIMEZONE}
|
||||||
|
volumes:
|
||||||
|
- ${DATA_PATH_HOST}/mysql:/var/lib/mysql
|
||||||
|
- ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:${MYSQL_PORT}:3306"
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
### MySQL ################################################
|
||||||
|
mysql-slave1:
|
||||||
|
build:
|
||||||
|
context: ./mysql-slave1
|
||||||
|
args:
|
||||||
|
- MYSQL_VERSION=${MYSQL_VERSION}
|
||||||
|
environment:
|
||||||
|
- MYSQL_DATABASE=${MYSQL_DATABASE}
|
||||||
|
- MYSQL_USER=${MYSQL_USER}
|
||||||
|
- MYSQL_PASSWORD=${MYSQL_PASSWORD}
|
||||||
|
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
|
||||||
|
- TZ=${TIMEZONE}
|
||||||
|
volumes:
|
||||||
|
- ${DATA_PATH_HOST}/mysql-slave1:/var/lib/mysql
|
||||||
|
- ${MYSQL_ENTRYPOINT_INITDB}:/docker-entrypoint-initdb.d
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:3307:3306"
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
### Redis ################################################
|
||||||
|
redis:
|
||||||
|
restart: always
|
||||||
|
build: ./redis
|
||||||
|
volumes:
|
||||||
|
- ${DATA_PATH_HOST}/redis:/data
|
||||||
|
command: redis-server --requirepass ${REDIS_PASSWORD}
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:${REDIS_PORT}:6379"
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
### SMTP ################################################
|
||||||
|
smtp:
|
||||||
|
restart: always
|
||||||
|
build: ./smtp
|
||||||
|
ports:
|
||||||
|
- "${SMTP_PORT}:25"
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
tty: true
|
||||||
|
|
||||||
|
### phpMyAdmin ###########################################
|
||||||
|
phpmyadmin:
|
||||||
|
build: ./phpmyadmin
|
||||||
|
environment:
|
||||||
|
- PMA_ARBITRARY=1
|
||||||
|
- MYSQL_USER=${PMA_USER}
|
||||||
|
- MYSQL_PASSWORD=${PMA_PASSWORD}
|
||||||
|
- MYSQL_ROOT_PASSWORD=${PMA_ROOT_PASSWORD}
|
||||||
|
- MAX_EXECUTION_TIME=${PMA_MAX_EXECUTION_TIME}
|
||||||
|
- MEMORY_LIMIT=${PMA_MEMORY_LIMIT}
|
||||||
|
- UPLOAD_LIMIT=${PMA_UPLOAD_LIMIT}
|
||||||
|
ports:
|
||||||
|
- "127.0.0.1:${PMA_PORT}:80"
|
||||||
|
depends_on:
|
||||||
|
- "${PMA_DB_ENGINE}"
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
|
|
||||||
|
### Certbot #########################################
|
||||||
|
certbot:
|
||||||
|
build:
|
||||||
|
context: ./certbot
|
||||||
|
volumes:
|
||||||
|
- ./data/certbot/certs/:/var/certs
|
||||||
|
- ./certbot/letsencrypt/:/var/www/letsencrypt
|
||||||
|
environment:
|
||||||
|
- CN="digital.opensem.ovh"
|
||||||
|
- EMAIL="ludo@huma.net"
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
|
||||||
|
### Docker-in-Docker ################################################
|
||||||
|
docker-in-docker:
|
||||||
|
image: docker:19.03-dind
|
||||||
|
environment:
|
||||||
|
DOCKER_TLS_SAN: DNS:docker-in-docker
|
||||||
|
privileged: true
|
||||||
|
volumes:
|
||||||
|
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}
|
||||||
|
- docker-in-docker:/certs/client
|
||||||
|
expose:
|
||||||
|
- 2375
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
### Soketi ###########################################
|
||||||
|
soketi:
|
||||||
|
restart: unless-stopped
|
||||||
|
image: 'quay.io/soketi/soketi:1.0-16-debian'
|
||||||
|
ports:
|
||||||
|
- '${SOKETI_PORT:-6001}:6001'
|
||||||
|
- '${SOKETI_METRICS_SERVER_PORT:-9601}:9601'
|
||||||
|
environment:
|
||||||
|
- SOKETI_DEBUG=1
|
||||||
|
- SOKETI_DEFAULT_APP_ID=${PUSHER_APP_ID}
|
||||||
|
- SOKETI_DEFAULT_APP_KEY=${PUSHER_APP_KEY}
|
||||||
|
- SOKETI_DEFAULT_APP_SECRET=${PUSHER_APP_SECRET}
|
||||||
|
- SOKETI_DEFAULT_APP_ENABLE_CLIENT_MESSAGES=true
|
||||||
|
- DEFAULT_APP_USER_AUTHENTICATION=true
|
||||||
|
expose:
|
||||||
|
- "6001"
|
||||||
|
extra_hosts:
|
||||||
|
- "dockerhost:${DOCKER_HOST_IP}"
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
- frontend
|
||||||
|
links:
|
||||||
|
- docker-in-docker
|
||||||
|
|
||||||
|
### Laravel Horizon ############################################
|
||||||
|
laravel-horizon:
|
||||||
|
build:
|
||||||
|
context: ./laravel-horizon
|
||||||
|
args:
|
||||||
|
- CHANGE_SOURCE=${CHANGE_SOURCE}
|
||||||
|
- LARADOCK_PHP_VERSION=${PHP_VERSION}
|
||||||
|
- INSTALL_BZ2=${LARAVEL_HORIZON_INSTALL_BZ2}
|
||||||
|
- INSTALL_GD=${LARAVEL_HORIZON_INSTALL_GD}
|
||||||
|
- INSTALL_GMP=${LARAVEL_HORIZON_INSTALL_GMP}
|
||||||
|
- INSTALL_GNUPG=${LARAVEL_HORIZON_INSTALL_GNUPG}
|
||||||
|
- INSTALL_LDAP=${LARAVEL_HORIZON_INSTALL_LDAP}
|
||||||
|
- INSTALL_IMAGEMAGICK=${LARAVEL_HORIZON_INSTALL_IMAGEMAGICK}
|
||||||
|
- INSTALL_PGSQL=${PHP_FPM_INSTALL_PGSQL}
|
||||||
|
- INSTALL_ZIP_ARCHIVE=${LARAVEL_HORIZON_INSTALL_ZIP_ARCHIVE}
|
||||||
|
- INSTALL_BCMATH=${PHP_FPM_INSTALL_BCMATH}
|
||||||
|
- INSTALL_MEMCACHED=${PHP_FPM_INSTALL_MEMCACHED}
|
||||||
|
- INSTALL_SOCKETS=${LARAVEL_HORIZON_INSTALL_SOCKETS}
|
||||||
|
- INSTALL_YAML=${LARAVEL_HORIZON_INSTALL_YAML}
|
||||||
|
- INSTALL_CASSANDRA=${LARAVEL_HORIZON_INSTALL_CASSANDRA}
|
||||||
|
- INSTALL_PHPREDIS=${LARAVEL_HORIZON_INSTALL_PHPREDIS}
|
||||||
|
- INSTALL_MONGO=${LARAVEL_HORIZON_INSTALL_MONGO}
|
||||||
|
- INSTALL_FFMPEG=${LARAVEL_HORIZON_INSTALL_FFMPEG}
|
||||||
|
- INSTALL_AUDIOWAVEFORM=${LARAVEL_HORIZON_INSTALL_AUDIOWAVEFORM}
|
||||||
|
- PUID=${LARAVEL_HORIZON_PUID}
|
||||||
|
- PGID=${LARAVEL_HORIZON_PGID}
|
||||||
|
- IMAGEMAGICK_VERSION=${LARAVEL_HORIZON_IMAGEMAGICK_VERSION}
|
||||||
|
volumes:
|
||||||
|
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}
|
||||||
|
- ./laravel-horizon/supervisord.d:/etc/supervisord.d
|
||||||
|
depends_on:
|
||||||
|
- workspace
|
||||||
|
extra_hosts:
|
||||||
|
- "dockerhost:${DOCKER_HOST_IP}"
|
||||||
|
networks:
|
||||||
|
- backend
|
||||||
|
|
||||||
|
### Proxy ###########################################
|
||||||
|
proxy:
|
||||||
|
restart: always
|
||||||
|
build:
|
||||||
|
context: ./proxy
|
||||||
|
args:
|
||||||
|
- PUID=${PUID}
|
||||||
|
- PGID=${PGID}
|
||||||
|
- TZ=${TIMEZONE}
|
||||||
|
- http_proxy
|
||||||
|
- https_proxy
|
||||||
|
- no_proxy
|
||||||
|
volumes:
|
||||||
|
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG}
|
||||||
|
- ${PROXY_HOST_LOG_PATH}:/var/log/nginx
|
||||||
|
- ${PROXY_SITES_PATH}:/etc/nginx/sites-available
|
||||||
|
- ${PROXY_SSL_PATH}:/etc/nginx/ssl
|
||||||
|
ports:
|
||||||
|
- "${NGINX_HOST_HTTP_PORT}:80"
|
||||||
|
- "${NGINX_HOST_HTTPS_PORT}:443"
|
||||||
|
networks:
|
||||||
|
- frontend
|
||||||
|
- backend
|
||||||
5
docker/matomo/Dockerfile
Normal file
5
docker/matomo/Dockerfile
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
FROM matomo:latest
|
||||||
|
# FROM bitnami/minideb:latest
|
||||||
|
|
||||||
|
LABEL maintainer="Ludovic CANDELLIER <ludo@huma.net>"
|
||||||
|
|
||||||
8
docker/matomo/run.sh
Normal file
8
docker/matomo/run.sh
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# service postfix start
|
||||||
|
|
||||||
|
# exec /usr/sbin/postconf maillog_file=/var/log/postfix.log
|
||||||
|
# exec /usr/sbin/postfix -c /etc/postfix start-fg
|
||||||
|
/etc/init.d/postfix start
|
||||||
|
|
||||||
20
docker/mysql/Dockerfile
Normal file
20
docker/mysql/Dockerfile
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
ARG MYSQL_VERSION
|
||||||
|
FROM mysql:latest
|
||||||
|
|
||||||
|
LABEL maintainer="Ludovic CANDELLIER <ludo@huma.net>"
|
||||||
|
|
||||||
|
#####################################
|
||||||
|
# Set Timezone
|
||||||
|
#####################################
|
||||||
|
|
||||||
|
ARG TZ=UTC
|
||||||
|
ENV TZ ${TZ}
|
||||||
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && chown -R mysql:root /var/lib/mysql/
|
||||||
|
|
||||||
|
COPY my.cnf /etc/mysql/conf.d/my.cnf
|
||||||
|
|
||||||
|
RUN chmod 0444 /etc/mysql/conf.d/my.cnf
|
||||||
|
|
||||||
|
CMD ["mysqld"]
|
||||||
|
|
||||||
|
EXPOSE 3306
|
||||||
1
docker/mysql/docker-entrypoint-initdb.d/.gitignore
vendored
Normal file
1
docker/mysql/docker-entrypoint-initdb.d/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.sql
|
||||||
33
docker/mysql/docker-entrypoint-initdb.d/createdb.sql.example
Normal file
33
docker/mysql/docker-entrypoint-initdb.d/createdb.sql.example
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
#
|
||||||
|
# Copy createdb.sql.example to createdb.sql
|
||||||
|
# then uncomment then set database name and username to create you need databases
|
||||||
|
#
|
||||||
|
# example: .env MYSQL_USER=appuser and needed db name is myshop_db
|
||||||
|
#
|
||||||
|
# CREATE DATABASE IF NOT EXISTS `myshop_db` ;
|
||||||
|
# GRANT ALL ON `myshop_db`.* TO 'appuser'@'%' ;
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# this sql script will auto run when the mysql container starts and the $DATA_PATH_HOST/mysql not found.
|
||||||
|
#
|
||||||
|
# if your $DATA_PATH_HOST/mysql exists and you do not want to delete it, you can run by manual execution:
|
||||||
|
#
|
||||||
|
# docker-compose exec mysql bash
|
||||||
|
# mysql -u root -p < /docker-entrypoint-initdb.d/createdb.sql
|
||||||
|
#
|
||||||
|
|
||||||
|
#CREATE DATABASE IF NOT EXISTS `dev_db_1` COLLATE 'utf8_general_ci' ;
|
||||||
|
#GRANT ALL ON `dev_db_1`.* TO 'default'@'%' ;
|
||||||
|
|
||||||
|
#CREATE DATABASE IF NOT EXISTS `dev_db_2` COLLATE 'utf8_general_ci' ;
|
||||||
|
#GRANT ALL ON `dev_db_2`.* TO 'default'@'%' ;
|
||||||
|
|
||||||
|
#CREATE DATABASE IF NOT EXISTS `dev_db_3` COLLATE 'utf8_general_ci' ;
|
||||||
|
#GRANT ALL ON `dev_db_3`.* TO 'default'@'%' ;
|
||||||
|
|
||||||
|
#CREATE DATABASE IF NOT EXISTS `opensem` COLLATE 'utf8_general_ci' ;
|
||||||
|
#GRANT ALL ON `opensem`.* TO 'opensem'@'%' ;
|
||||||
|
|
||||||
|
#GRANT ALL PRIVILEGES ON *.* TO opensem@localhost WITH GRANT OPTION;
|
||||||
|
|
||||||
|
FLUSH PRIVILEGES ;
|
||||||
11
docker/mysql/my.cnf
Normal file
11
docker/mysql/my.cnf
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
# The MySQL Client configuration file.
|
||||||
|
#
|
||||||
|
# For explanations see
|
||||||
|
# http://dev.mysql.com/doc/mysql/en/server-system-variables.html
|
||||||
|
|
||||||
|
[mysql]
|
||||||
|
|
||||||
|
[mysqld]
|
||||||
|
sql-mode="STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION"
|
||||||
|
character-set-server=utf8
|
||||||
|
default-authentication-plugin=mysql_native_password
|
||||||
43
docker/nginx/Dockerfile
Normal file
43
docker/nginx/Dockerfile
Normal file
@@ -0,0 +1,43 @@
|
|||||||
|
FROM nginx:alpine
|
||||||
|
|
||||||
|
LABEL maintainer="Ludovic CANDELLIER <ludo@huma.net>"
|
||||||
|
|
||||||
|
COPY nginx.conf /etc/nginx/
|
||||||
|
|
||||||
|
RUN apk update \
|
||||||
|
&& apk upgrade \
|
||||||
|
&& apk --update add logrotate \
|
||||||
|
&& apk add --no-cache openssl \
|
||||||
|
&& apk add --no-cache bash
|
||||||
|
|
||||||
|
RUN apk add --no-cache curl
|
||||||
|
|
||||||
|
# Add a non-root user:
|
||||||
|
ARG PUID=1000
|
||||||
|
ENV PUID ${PUID}
|
||||||
|
ARG PGID=1000
|
||||||
|
ENV PGID ${PGID}
|
||||||
|
|
||||||
|
RUN addgroup -g ${PGID} -S www-data ; \
|
||||||
|
adduser -u ${PUID} -D -S -G www-data www-data && exit 0 ; exit 1
|
||||||
|
|
||||||
|
WORKDIR /var/www
|
||||||
|
|
||||||
|
ARG PHP_UPSTREAM_CONTAINER=php-fpm
|
||||||
|
ARG PHP_UPSTREAM_PORT=9000
|
||||||
|
|
||||||
|
# Create 'messages' file used from 'logrotate'
|
||||||
|
RUN touch /var/log/messages
|
||||||
|
|
||||||
|
# Copy 'logrotate' config file
|
||||||
|
COPY logrotate/nginx /etc/logrotate.d/
|
||||||
|
|
||||||
|
# Set upstream conf and remove the default conf
|
||||||
|
RUN echo "upstream php-upstream { server ${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT}; }" > /etc/nginx/conf.d/upstream.conf \
|
||||||
|
&& rm /etc/nginx/conf.d/default.conf
|
||||||
|
|
||||||
|
ADD ./startup.sh /opt/startup.sh
|
||||||
|
RUN sed -i 's/\r//g' /opt/startup.sh
|
||||||
|
CMD ["/bin/bash", "/opt/startup.sh"]
|
||||||
|
|
||||||
|
EXPOSE 80 443
|
||||||
14
docker/nginx/logrotate/nginx
Normal file
14
docker/nginx/logrotate/nginx
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
/var/log/nginx/*.log {
|
||||||
|
daily
|
||||||
|
missingok
|
||||||
|
rotate 32
|
||||||
|
compress
|
||||||
|
delaycompress
|
||||||
|
nodateext
|
||||||
|
notifempty
|
||||||
|
create 644 www-data root
|
||||||
|
sharedscripts
|
||||||
|
postrotate
|
||||||
|
[ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
|
||||||
|
endscript
|
||||||
|
}
|
||||||
35
docker/nginx/nginx.conf
Normal file
35
docker/nginx/nginx.conf
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
user www-data;
|
||||||
|
worker_processes 4;
|
||||||
|
pid /run/nginx.pid;
|
||||||
|
daemon off;
|
||||||
|
|
||||||
|
events {
|
||||||
|
worker_connections 2048;
|
||||||
|
multi_accept on;
|
||||||
|
use epoll;
|
||||||
|
}
|
||||||
|
|
||||||
|
http {
|
||||||
|
server_names_hash_bucket_size 128;
|
||||||
|
server_tokens off;
|
||||||
|
sendfile on;
|
||||||
|
tcp_nopush on;
|
||||||
|
tcp_nodelay on;
|
||||||
|
keepalive_timeout 15;
|
||||||
|
types_hash_max_size 2048;
|
||||||
|
client_max_body_size 128M;
|
||||||
|
include /etc/nginx/mime.types;
|
||||||
|
default_type application/octet-stream;
|
||||||
|
access_log /dev/stdout;
|
||||||
|
error_log /dev/stderr;
|
||||||
|
gzip on;
|
||||||
|
gzip_disable "msie6";
|
||||||
|
|
||||||
|
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
|
||||||
|
ssl_ciphers 'ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:ECDHE-ECDSA-DES-CBC3-SHA:ECDHE-RSA-DES-CBC3-SHA:EDH-RSA-DES-CBC3-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:DES-CBC3-SHA:!DSS';
|
||||||
|
|
||||||
|
include /etc/nginx/conf.d/*.conf;
|
||||||
|
include /etc/nginx/sites-available/*.conf;
|
||||||
|
open_file_cache off; # Disabled for issue 619
|
||||||
|
charset UTF-8;
|
||||||
|
}
|
||||||
2
docker/nginx/sites/.gitignore
vendored
Normal file
2
docker/nginx/sites/.gitignore
vendored
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
*.conf
|
||||||
|
!default.conf
|
||||||
40
docker/nginx/sites/default.conf
Normal file
40
docker/nginx/sites/default.conf
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
server {
|
||||||
|
|
||||||
|
listen 80 default_server;
|
||||||
|
listen [::]:80 default_server ipv6only=on;
|
||||||
|
|
||||||
|
# For https
|
||||||
|
# listen 443 ssl default_server;
|
||||||
|
# listen [::]:443 ssl default_server ipv6only=on;
|
||||||
|
# ssl_certificate /etc/nginx/ssl/default.crt;
|
||||||
|
# ssl_certificate_key /etc/nginx/ssl/default.key;
|
||||||
|
|
||||||
|
server_name localhost;
|
||||||
|
root /var/www/public;
|
||||||
|
index index.php index.html index.htm;
|
||||||
|
|
||||||
|
location / {
|
||||||
|
try_files $uri $uri/ /index.php$is_args$args;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ \.php$ {
|
||||||
|
try_files $uri /index.php =404;
|
||||||
|
fastcgi_pass php-upstream;
|
||||||
|
fastcgi_index index.php;
|
||||||
|
fastcgi_buffers 16 16k;
|
||||||
|
fastcgi_buffer_size 32k;
|
||||||
|
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
|
||||||
|
#fixes timeouts
|
||||||
|
fastcgi_read_timeout 600;
|
||||||
|
include fastcgi_params;
|
||||||
|
}
|
||||||
|
|
||||||
|
location ~ /\.ht {
|
||||||
|
deny all;
|
||||||
|
}
|
||||||
|
|
||||||
|
location /.well-known/acme-challenge/ {
|
||||||
|
root /var/www/letsencrypt/;
|
||||||
|
log_not_found off;
|
||||||
|
}
|
||||||
|
}
|
||||||
4
docker/nginx/ssl/.gitignore
vendored
Normal file
4
docker/nginx/ssl/.gitignore
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
*.crt
|
||||||
|
*.csr
|
||||||
|
*.key
|
||||||
|
*.pem
|
||||||
14
docker/nginx/startup.sh
Normal file
14
docker/nginx/startup.sh
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
if [ ! -f /etc/nginx/ssl/default.crt ]; then
|
||||||
|
openssl genrsa -out "/etc/nginx/ssl/default.key" 2048
|
||||||
|
openssl req -new -key "/etc/nginx/ssl/default.key" -out "/etc/nginx/ssl/default.csr" -subj "/CN=default/O=default/C=UK"
|
||||||
|
openssl x509 -req -days 365 -in "/etc/nginx/ssl/default.csr" -signkey "/etc/nginx/ssl/default.key" -out "/etc/nginx/ssl/default.crt"
|
||||||
|
chmod 644 /etc/nginx/ssl/default.key
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Start crond in background
|
||||||
|
crond -l 2 -b
|
||||||
|
|
||||||
|
# Start nginx in foreground
|
||||||
|
nginx
|
||||||
1330
docker/php-fpm/Dockerfile
Normal file
1330
docker/php-fpm/Dockerfile
Normal file
File diff suppressed because it is too large
Load Diff
3
docker/php-fpm/aerospike.ini
Normal file
3
docker/php-fpm/aerospike.ini
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
extension=aerospike.so
|
||||||
|
aerospike.udf.lua_system_path=/usr/local/aerospike/lua
|
||||||
|
aerospike.udf.lua_user_path=/usr/local/aerospike/usr-lua
|
||||||
1
docker/php-fpm/apt_sources/php.list
Normal file
1
docker/php-fpm/apt_sources/php.list
Normal file
@@ -0,0 +1 @@
|
|||||||
|
deb https://packages.sury.org/php/ bullseye main
|
||||||
18
docker/php-fpm/install.sh
Normal file
18
docker/php-fpm/install.sh
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
git clone https://gitlab+deploy-token-1:dzY3LM8b6mmmsZsym_x-@gitlab.tools.digital.opensem.com/root/fgdigital.git $(pwd)
|
||||||
|
mv /home/laradock/.env ./
|
||||||
|
mkdir -p bootstrap/cache
|
||||||
|
chmod -R 777 bootstrap/cache
|
||||||
|
# mkdir -p storage/framework
|
||||||
|
# mkdir -p storage/framework/{sessions,views,cache}
|
||||||
|
composer install
|
||||||
|
composer update
|
||||||
|
php artisan cache:clear
|
||||||
|
php artisan config:clear
|
||||||
|
php artisan view:clear
|
||||||
|
php artisan storage:link
|
||||||
|
php artisan laroute:generate
|
||||||
|
yarn install
|
||||||
|
npm run prod
|
||||||
|
grunt dev
|
||||||
16
docker/php-fpm/laravel.ini
Normal file
16
docker/php-fpm/laravel.ini
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
date.timezone=UTC
|
||||||
|
display_errors=Off
|
||||||
|
log_errors=On
|
||||||
|
|
||||||
|
; Maximum amount of memory a script may consume (128MB)
|
||||||
|
; http://php.net/memory-limit
|
||||||
|
memory_limit = 256M
|
||||||
|
; Maximum allowed size for uploaded files.
|
||||||
|
; http://php.net/upload-max-filesize
|
||||||
|
upload_max_filesize = 20M
|
||||||
|
; Sets max size of post data allowed.
|
||||||
|
; http://php.net/post-max-size
|
||||||
|
post_max_size = 20M
|
||||||
|
max_execution_time=600
|
||||||
|
default_socket_timeout=3600
|
||||||
|
request_terminate_timeout=600
|
||||||
58
docker/php-fpm/mysql.ini
Normal file
58
docker/php-fpm/mysql.ini
Normal file
@@ -0,0 +1,58 @@
|
|||||||
|
[MySQL]
|
||||||
|
; Allow accessing, from PHP's perspective, local files with LOAD DATA statements
|
||||||
|
; http://php.net/mysql.allow_local_infile
|
||||||
|
mysql.allow_local_infile = On
|
||||||
|
|
||||||
|
; Allow or prevent persistent links.
|
||||||
|
; http://php.net/mysql.allow-persistent
|
||||||
|
mysql.allow_persistent = On
|
||||||
|
|
||||||
|
; If mysqlnd is used: Number of cache slots for the internal result set cache
|
||||||
|
; http://php.net/mysql.cache_size
|
||||||
|
mysql.cache_size = 2000
|
||||||
|
|
||||||
|
; Maximum number of persistent links. -1 means no limit.
|
||||||
|
; http://php.net/mysql.max-persistent
|
||||||
|
mysql.max_persistent = -1
|
||||||
|
|
||||||
|
; Maximum number of links (persistent + non-persistent). -1 means no limit.
|
||||||
|
; http://php.net/mysql.max-links
|
||||||
|
mysql.max_links = -1
|
||||||
|
|
||||||
|
; Default port number for mysql_connect(). If unset, mysql_connect() will use
|
||||||
|
; the $MYSQL_TCP_PORT or the mysql-tcp entry in /etc/services or the
|
||||||
|
; compile-time value defined MYSQL_PORT (in that order). Win32 will only look
|
||||||
|
; at MYSQL_PORT.
|
||||||
|
; http://php.net/mysql.default-port
|
||||||
|
mysql.default_port =
|
||||||
|
|
||||||
|
; Default socket name for local MySQL connects. If empty, uses the built-in
|
||||||
|
; MySQL defaults.
|
||||||
|
; http://php.net/mysql.default-socket
|
||||||
|
mysql.default_socket =
|
||||||
|
|
||||||
|
; Default host for mysql_connect() (doesn't apply in safe mode).
|
||||||
|
; http://php.net/mysql.default-host
|
||||||
|
mysql.default_host =
|
||||||
|
|
||||||
|
; Default user for mysql_connect() (doesn't apply in safe mode).
|
||||||
|
; http://php.net/mysql.default-user
|
||||||
|
mysql.default_user =
|
||||||
|
|
||||||
|
; Default password for mysql_connect() (doesn't apply in safe mode).
|
||||||
|
; Note that this is generally a *bad* idea to store passwords in this file.
|
||||||
|
; *Any* user with PHP access can run 'echo get_cfg_var("mysql.default_password")
|
||||||
|
; and reveal this password! And of course, any users with read access to this
|
||||||
|
; file will be able to reveal the password as well.
|
||||||
|
; http://php.net/mysql.default-password
|
||||||
|
mysql.default_password =
|
||||||
|
|
||||||
|
; Maximum time (in seconds) for connect timeout. -1 means no limit
|
||||||
|
; http://php.net/mysql.connect-timeout
|
||||||
|
mysql.connect_timeout = 60
|
||||||
|
|
||||||
|
; Trace mode. When trace_mode is active (=On), warnings for table/index scans and
|
||||||
|
; SQL-Errors will be displayed.
|
||||||
|
; http://php.net/mysql.trace-mode
|
||||||
|
mysql.trace_mode = Off
|
||||||
|
|
||||||
9
docker/php-fpm/opcache.ini
Normal file
9
docker/php-fpm/opcache.ini
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
; NOTE: The actual opcache.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-opcache.ini)
|
||||||
|
|
||||||
|
opcache.enable=1
|
||||||
|
opcache.memory_consumption=256
|
||||||
|
opcache.use_cwd=0
|
||||||
|
opcache.max_file_size=0
|
||||||
|
opcache.max_accelerated_files=30000
|
||||||
|
opcache.validate_timestamps=1
|
||||||
|
opcache.revalidate_freq=0
|
||||||
2
docker/php-fpm/phalcon.ini
Normal file
2
docker/php-fpm/phalcon.ini
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
extension=psr.so
|
||||||
|
extension=phalcon.so
|
||||||
2030
docker/php-fpm/php5.6.ini
Normal file
2030
docker/php-fpm/php5.6.ini
Normal file
File diff suppressed because it is too large
Load Diff
1918
docker/php-fpm/php7.0.ini
Normal file
1918
docker/php-fpm/php7.0.ini
Normal file
File diff suppressed because it is too large
Load Diff
1918
docker/php-fpm/php7.1.ini
Normal file
1918
docker/php-fpm/php7.1.ini
Normal file
File diff suppressed because it is too large
Load Diff
1918
docker/php-fpm/php7.2.ini
Normal file
1918
docker/php-fpm/php7.2.ini
Normal file
File diff suppressed because it is too large
Load Diff
1918
docker/php-fpm/php7.3.ini
Normal file
1918
docker/php-fpm/php7.3.ini
Normal file
File diff suppressed because it is too large
Load Diff
1918
docker/php-fpm/php7.4.ini
Normal file
1918
docker/php-fpm/php7.4.ini
Normal file
File diff suppressed because it is too large
Load Diff
1944
docker/php-fpm/php8.0.ini
Normal file
1944
docker/php-fpm/php8.0.ini
Normal file
File diff suppressed because it is too large
Load Diff
1948
docker/php-fpm/php8.1.ini
Normal file
1948
docker/php-fpm/php8.1.ini
Normal file
File diff suppressed because it is too large
Load Diff
1955
docker/php-fpm/php8.2.ini
Normal file
1955
docker/php-fpm/php8.2.ini
Normal file
File diff suppressed because it is too large
Load Diff
101
docker/php-fpm/xdebug
Normal file
101
docker/php-fpm/xdebug
Normal file
@@ -0,0 +1,101 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
# NOTE: At the moment, this has only been confirmed to work with PHP 7
|
||||||
|
|
||||||
|
|
||||||
|
# Grab full name of php-fpm container
|
||||||
|
PHP_FPM_CONTAINER=$(docker ps | grep php-fpm | awk '{print $1}')
|
||||||
|
|
||||||
|
|
||||||
|
# Grab OS type
|
||||||
|
if [[ "$(uname)" == "Darwin" ]]; then
|
||||||
|
OS_TYPE="OSX"
|
||||||
|
else
|
||||||
|
OS_TYPE=$(expr substr $(uname -s) 1 5)
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
xdebug_status ()
|
||||||
|
{
|
||||||
|
echo 'xDebug status'
|
||||||
|
|
||||||
|
# If running on Windows, need to prepend with winpty :(
|
||||||
|
if [[ $OS_TYPE == "MINGW" ]]; then
|
||||||
|
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||||
|
|
||||||
|
else
|
||||||
|
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||||
|
fi
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
xdebug_start ()
|
||||||
|
{
|
||||||
|
echo 'Start xDebug'
|
||||||
|
|
||||||
|
# And uncomment line with xdebug extension, thus enabling it
|
||||||
|
ON_CMD="sed -i 's/^;zend_extension=/zend_extension=/g' \
|
||||||
|
/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini"
|
||||||
|
|
||||||
|
|
||||||
|
# If running on Windows, need to prepend with winpty :(
|
||||||
|
if [[ $OS_TYPE == "MINGW" ]]; then
|
||||||
|
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}"
|
||||||
|
docker restart $PHP_FPM_CONTAINER
|
||||||
|
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||||
|
|
||||||
|
else
|
||||||
|
docker exec -it $PHP_FPM_CONTAINER bash -c "${ON_CMD}"
|
||||||
|
docker restart $PHP_FPM_CONTAINER
|
||||||
|
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
xdebug_stop ()
|
||||||
|
{
|
||||||
|
echo 'Stop xDebug'
|
||||||
|
|
||||||
|
# Comment out xdebug extension line
|
||||||
|
OFF_CMD="sed -i 's/^zend_extension=/;zend_extension=/g' /usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini"
|
||||||
|
|
||||||
|
|
||||||
|
# If running on Windows, need to prepend with winpty :(
|
||||||
|
if [[ $OS_TYPE == "MINGW" ]]; then
|
||||||
|
# This is the equivalent of:
|
||||||
|
# winpty docker exec -it laradock_php-fpm_1 bash -c 'bla bla bla'
|
||||||
|
# Thanks to @michaelarnauts at https://github.com/docker/compose/issues/593
|
||||||
|
winpty docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}"
|
||||||
|
docker restart $PHP_FPM_CONTAINER
|
||||||
|
#docker-compose restart php-fpm
|
||||||
|
winpty docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||||
|
|
||||||
|
else
|
||||||
|
docker exec -it $PHP_FPM_CONTAINER bash -c "${OFF_CMD}"
|
||||||
|
# docker-compose restart php-fpm
|
||||||
|
docker restart $PHP_FPM_CONTAINER
|
||||||
|
docker exec -it $PHP_FPM_CONTAINER bash -c 'php -v'
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
case $@ in
|
||||||
|
stop|STOP)
|
||||||
|
xdebug_stop
|
||||||
|
;;
|
||||||
|
start|START)
|
||||||
|
xdebug_start
|
||||||
|
;;
|
||||||
|
status|STATUS)
|
||||||
|
xdebug_status
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "xDebug [Stop | Start | Status] in the ${PHP_FPM_CONTAINER} container."
|
||||||
|
echo "xDebug must have already been installed."
|
||||||
|
echo "Usage:"
|
||||||
|
echo " .php-fpm/xdebug stop|start|status"
|
||||||
|
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit 1
|
||||||
19
docker/php-fpm/xdebug.ini
Normal file
19
docker/php-fpm/xdebug.ini
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
; NOTE: The actual debug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini)
|
||||||
|
|
||||||
|
xdebug.remote_host="host.docker.internal"
|
||||||
|
xdebug.remote_connect_back=0
|
||||||
|
xdebug.remote_port=9000
|
||||||
|
xdebug.idekey=PHPSTORM
|
||||||
|
|
||||||
|
xdebug.remote_autostart=0
|
||||||
|
xdebug.remote_enable=0
|
||||||
|
xdebug.cli_color=0
|
||||||
|
xdebug.profiler_enable=0
|
||||||
|
xdebug.profiler_output_dir="~/xdebug/phpstorm/tmp/profiling"
|
||||||
|
|
||||||
|
xdebug.remote_handler=dbgp
|
||||||
|
xdebug.remote_mode=req
|
||||||
|
|
||||||
|
xdebug.var_display_max_children=-1
|
||||||
|
xdebug.var_display_max_data=-1
|
||||||
|
xdebug.var_display_max_depth=-1
|
||||||
8
docker/php-fpm/xhprof.ini
Normal file
8
docker/php-fpm/xhprof.ini
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
[xhprof]
|
||||||
|
; extension=xhprof.so
|
||||||
|
extension=tideways_xhprof.so
|
||||||
|
xhprof.output_dir=/var/www/xhprof
|
||||||
|
; no need to autoload, control in the program
|
||||||
|
tideways.auto_prepend_library=0
|
||||||
|
; set default rate
|
||||||
|
tideways.sample_rate=100
|
||||||
76
docker/php-fpm/xlaravel.pool.conf
Normal file
76
docker/php-fpm/xlaravel.pool.conf
Normal file
@@ -0,0 +1,76 @@
|
|||||||
|
; Unix user/group of processes
|
||||||
|
; Note: The user is mandatory. If the group is not set, the default user's group
|
||||||
|
; will be used.
|
||||||
|
user = www-data
|
||||||
|
group = www-data
|
||||||
|
|
||||||
|
; The address on which to accept FastCGI requests.
|
||||||
|
; Valid syntaxes are:
|
||||||
|
; 'ip.add.re.ss:port' - to listen on a TCP socket to a specific address on
|
||||||
|
; a specific port;
|
||||||
|
; 'port' - to listen on a TCP socket to all addresses on a
|
||||||
|
; specific port;
|
||||||
|
; '/path/to/unix/socket' - to listen on a unix socket.
|
||||||
|
; Note: This value is mandatory.
|
||||||
|
listen = 0.0.0.0:9000
|
||||||
|
|
||||||
|
; Choose how the process manager will control the number of child processes.
|
||||||
|
; Possible Values:
|
||||||
|
; static - a fixed number (pm.max_children) of child processes;
|
||||||
|
; dynamic - the number of child processes are set dynamically based on the
|
||||||
|
; following directives. With this process management, there will be
|
||||||
|
; always at least 1 children.
|
||||||
|
; pm.max_children - the maximum number of children that can
|
||||||
|
; be alive at the same time.
|
||||||
|
; pm.start_servers - the number of children created on startup.
|
||||||
|
; pm.min_spare_servers - the minimum number of children in 'idle'
|
||||||
|
; state (waiting to process). If the number
|
||||||
|
; of 'idle' processes is less than this
|
||||||
|
; number then some children will be created.
|
||||||
|
; pm.max_spare_servers - the maximum number of children in 'idle'
|
||||||
|
; state (waiting to process). If the number
|
||||||
|
; of 'idle' processes is greater than this
|
||||||
|
; number then some children will be killed.
|
||||||
|
; ondemand - no children are created at startup. Children will be forked when
|
||||||
|
; new requests will connect. The following parameter are used:
|
||||||
|
; pm.max_children - the maximum number of children that
|
||||||
|
; can be alive at the same time.
|
||||||
|
; pm.process_idle_timeout - The number of seconds after which
|
||||||
|
; an idle process will be killed.
|
||||||
|
; Note: This value is mandatory.
|
||||||
|
pm = dynamic
|
||||||
|
|
||||||
|
; The number of child processes to be created when pm is set to 'static' and the
|
||||||
|
; maximum number of child processes when pm is set to 'dynamic' or 'ondemand'.
|
||||||
|
; This value sets the limit on the number of simultaneous requests that will be
|
||||||
|
; served. Equivalent to the ApacheMaxClients directive with mpm_prefork.
|
||||||
|
; Equivalent to the PHP_FCGI_CHILDREN environment variable in the original PHP
|
||||||
|
; CGI. The below defaults are based on a server without much resources. Don't
|
||||||
|
; forget to tweak pm.* to fit your needs.
|
||||||
|
; Note: Used when pm is set to 'static', 'dynamic' or 'ondemand'
|
||||||
|
; Note: This value is mandatory.
|
||||||
|
pm.max_children = 20
|
||||||
|
|
||||||
|
; The number of child processes created on startup.
|
||||||
|
; Note: Used only when pm is set to 'dynamic'
|
||||||
|
; Default Value: min_spare_servers + (max_spare_servers - min_spare_servers) / 2
|
||||||
|
pm.start_servers = 2
|
||||||
|
|
||||||
|
; The desired minimum number of idle server processes.
|
||||||
|
; Note: Used only when pm is set to 'dynamic'
|
||||||
|
; Note: Mandatory when pm is set to 'dynamic'
|
||||||
|
pm.min_spare_servers = 1
|
||||||
|
|
||||||
|
; The desired maximum number of idle server processes.
|
||||||
|
; Note: Used only when pm is set to 'dynamic'
|
||||||
|
; Note: Mandatory when pm is set to 'dynamic'
|
||||||
|
pm.max_spare_servers = 3
|
||||||
|
|
||||||
|
;---------------------
|
||||||
|
|
||||||
|
; Make specific Docker environment variables available to PHP
|
||||||
|
env[DB_1_ENV_MYSQL_DATABASE] = $DB_1_ENV_MYSQL_DATABASE
|
||||||
|
env[DB_1_ENV_MYSQL_USER] = $DB_1_ENV_MYSQL_USER
|
||||||
|
env[DB_1_ENV_MYSQL_PASSWORD] = $DB_1_ENV_MYSQL_PASSWORD
|
||||||
|
|
||||||
|
catch_workers_output = yes
|
||||||
194
docker/php-worker/Dockerfile
Normal file
194
docker/php-worker/Dockerfile
Normal file
@@ -0,0 +1,194 @@
|
|||||||
|
#
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
# Image Setup
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
|
||||||
|
ARG LARADOCK_PHP_VERSION
|
||||||
|
ARG BASE_IMAGE_TAG_PREFIX=latest
|
||||||
|
|
||||||
|
FROM php:${LARADOCK_PHP_VERSION}-alpine
|
||||||
|
|
||||||
|
LABEL maintainer="Ludovic CANDELLIER <ludo@huma.net>"
|
||||||
|
|
||||||
|
ARG LARADOCK_PHP_VERSION
|
||||||
|
|
||||||
|
RUN apk --update add wget \
|
||||||
|
curl \
|
||||||
|
git \
|
||||||
|
build-base \
|
||||||
|
libmcrypt-dev \
|
||||||
|
libxml2-dev \
|
||||||
|
pcre-dev \
|
||||||
|
zlib-dev \
|
||||||
|
autoconf \
|
||||||
|
cyrus-sasl-dev \
|
||||||
|
libgsasl-dev \
|
||||||
|
oniguruma-dev \
|
||||||
|
ghostscript \
|
||||||
|
openssl \
|
||||||
|
openssl-dev \
|
||||||
|
supervisor \
|
||||||
|
chromium
|
||||||
|
|
||||||
|
|
||||||
|
RUN pecl channel-update pecl.php.net; \
|
||||||
|
docker-php-ext-install mysqli mbstring pdo pdo_mysql tokenizer xml pcntl
|
||||||
|
|
||||||
|
# Add a non-root user:
|
||||||
|
ARG PUID=1000
|
||||||
|
ENV PUID ${PUID}
|
||||||
|
ARG PGID=1000
|
||||||
|
ENV PGID ${PGID}
|
||||||
|
|
||||||
|
RUN addgroup -g ${PGID} laradock && \
|
||||||
|
adduser -D -G laradock -u ${PUID} laradock
|
||||||
|
|
||||||
|
#RUN apk add tzdata \
|
||||||
|
# cp /usr/share/zoneinfo/Europe/Paris /etc/localtime \
|
||||||
|
# echo "Europe/Paris" > /etc/timezone
|
||||||
|
|
||||||
|
#Install BZ2:
|
||||||
|
ARG INSTALL_BZ2=false
|
||||||
|
RUN if [ ${INSTALL_BZ2} = true ]; then \
|
||||||
|
apk --update add bzip2-dev; \
|
||||||
|
docker-php-ext-install bz2; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
#Install GD package:
|
||||||
|
ARG INSTALL_GD=false
|
||||||
|
RUN if [ ${INSTALL_GD} = true ]; then \
|
||||||
|
apk add --update --no-cache freetype-dev libjpeg-turbo-dev jpeg-dev libpng-dev; \
|
||||||
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "7" ] && [ $(php -r "echo PHP_MINOR_VERSION;") = "4" ]; then \
|
||||||
|
docker-php-ext-configure gd --with-freetype --with-jpeg --with-png; \
|
||||||
|
else \
|
||||||
|
docker-php-ext-configure gd --with-freetype-dir=/usr/lib/ --with-jpeg-dir=/usr/lib/ --with-png-dir=/usr/lib/; \
|
||||||
|
fi; \
|
||||||
|
docker-php-ext-install gd \
|
||||||
|
;fi
|
||||||
|
|
||||||
|
#Install ImageMagick:
|
||||||
|
ARG INSTALL_IMAGEMAGICK=false
|
||||||
|
ARG IMAGEMAGICK_VERSION=latest
|
||||||
|
ENV IMAGEMAGICK_VERSION ${IMAGEMAGICK_VERSION}
|
||||||
|
RUN set -eux; \
|
||||||
|
if [ ${INSTALL_IMAGEMAGICK} = true ]; then \
|
||||||
|
apk add --update --no-cache imagemagick-dev imagemagick; \
|
||||||
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
|
||||||
|
cd /tmp && \
|
||||||
|
if [ ${IMAGEMAGICK_VERSION} = "latest" ]; then \
|
||||||
|
git clone https://github.com/Imagick/imagick; \
|
||||||
|
else \
|
||||||
|
git clone --branch ${IMAGEMAGICK_VERSION} https://github.com/Imagick/imagick; \
|
||||||
|
fi && \
|
||||||
|
cd imagick && \
|
||||||
|
phpize && \
|
||||||
|
./configure && \
|
||||||
|
make && \
|
||||||
|
make install && \
|
||||||
|
rm -r /tmp/imagick; \
|
||||||
|
else \
|
||||||
|
pecl install imagick; \
|
||||||
|
fi && \
|
||||||
|
docker-php-ext-enable imagick; \
|
||||||
|
php -m | grep -q 'imagick'; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
#Install GMP package:
|
||||||
|
ARG INSTALL_GMP=false
|
||||||
|
RUN if [ ${INSTALL_GMP} = true ]; then \
|
||||||
|
apk add --update --no-cache gmp gmp-dev \
|
||||||
|
&& docker-php-ext-install gmp \
|
||||||
|
;fi
|
||||||
|
|
||||||
|
#Install BCMath package:
|
||||||
|
ARG INSTALL_BCMATH=false
|
||||||
|
RUN if [ ${INSTALL_BCMATH} = true ]; then \
|
||||||
|
docker-php-ext-install bcmath \
|
||||||
|
;fi
|
||||||
|
|
||||||
|
# Install ZipArchive:
|
||||||
|
ARG INSTALL_ZIP_ARCHIVE=false
|
||||||
|
RUN set -eux; \
|
||||||
|
if [ ${INSTALL_ZIP_ARCHIVE} = true ]; then \
|
||||||
|
apk --update add libzip-dev && \
|
||||||
|
if [ ${LARADOCK_PHP_VERSION} = "7.3" ] || [ ${LARADOCK_PHP_VERSION} = "7.4" ] || [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \
|
||||||
|
docker-php-ext-configure zip; \
|
||||||
|
else \
|
||||||
|
docker-php-ext-configure zip --with-libzip; \
|
||||||
|
fi && \
|
||||||
|
# Install the zip extension
|
||||||
|
docker-php-ext-install zip \
|
||||||
|
;fi
|
||||||
|
|
||||||
|
# Install MySQL Client:
|
||||||
|
ARG INSTALL_MYSQL_CLIENT=false
|
||||||
|
RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \
|
||||||
|
apk --update add mysql-client \
|
||||||
|
;fi
|
||||||
|
|
||||||
|
ARG INSTALL_GHOSTSCRIPT=false
|
||||||
|
RUN if [ $INSTALL_GHOSTSCRIPT = true ]; then \
|
||||||
|
apk --update add ghostscript \
|
||||||
|
;fi
|
||||||
|
|
||||||
|
# Install Redis package:
|
||||||
|
ARG INSTALL_REDIS=false
|
||||||
|
RUN if [ ${INSTALL_REDIS} = true ]; then \
|
||||||
|
# Install Redis Extension
|
||||||
|
if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \
|
||||||
|
printf "\n" | pecl install -o -f redis-4.3.0; \
|
||||||
|
else \
|
||||||
|
printf "\n" | pecl install -o -f redis; \
|
||||||
|
fi; \
|
||||||
|
rm -rf /tmp/pear; \
|
||||||
|
docker-php-ext-enable redis \
|
||||||
|
;fi
|
||||||
|
|
||||||
|
#
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
# Optional Supervisord Configuration
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# Modify the ./supervisor.conf file to match your App's requirements.
|
||||||
|
# Make sure you rebuild your container with every change.
|
||||||
|
#
|
||||||
|
|
||||||
|
COPY supervisord.conf /etc/supervisord.conf
|
||||||
|
|
||||||
|
ENTRYPOINT ["/usr/bin/supervisord", "-n", "-c", "/etc/supervisord.conf"]
|
||||||
|
|
||||||
|
#
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
# Optional Software's Installation
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
# If you need to modify this image, feel free to do it right here.
|
||||||
|
#
|
||||||
|
# -- Your awesome modifications go here -- #
|
||||||
|
|
||||||
|
#
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
# Check PHP version
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
|
||||||
|
RUN cd /usr/local/etc/php/conf.d/ && \
|
||||||
|
echo 'memory_limit = -1' >> /usr/local/etc/php/conf.d/docker-php-ram-limit.ini
|
||||||
|
|
||||||
|
RUN cd /usr/local/etc/php/conf.d/ && \
|
||||||
|
echo 'max_execution_time = 0' >> /usr/local/etc/php/conf.d/docker-php-exec-limit.ini
|
||||||
|
|
||||||
|
RUN php -v | head -n 1 | grep -q "PHP ${PHP_VERSION}."
|
||||||
|
|
||||||
|
#
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
# Final Touch
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
|
||||||
|
# Clean up
|
||||||
|
RUN rm /var/cache/apk/* \
|
||||||
|
&& mkdir -p /var/www
|
||||||
|
|
||||||
|
WORKDIR /etc/supervisor/conf.d/
|
||||||
1944
docker/php-worker/php8.0.ini
Normal file
1944
docker/php-worker/php8.0.ini
Normal file
File diff suppressed because it is too large
Load Diff
10
docker/php-worker/supervisord.conf
Normal file
10
docker/php-worker/supervisord.conf
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
[supervisord]
|
||||||
|
nodaemon=true
|
||||||
|
[supervisorctl]
|
||||||
|
[inet_http_server]
|
||||||
|
port = 127.0.0.1:9001
|
||||||
|
[rpcinterface:supervisor]
|
||||||
|
supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface
|
||||||
|
|
||||||
|
[include]
|
||||||
|
files = supervisord.d/*.conf
|
||||||
1
docker/php-worker/supervisord.d/.gitignore
vendored
Normal file
1
docker/php-worker/supervisord.d/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
*.conf
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
[program:laravel-scheduler]
|
||||||
|
process_name=%(program_name)s_%(process_num)02d
|
||||||
|
command=/bin/sh -c "while [ true ]; do (php /var/www/artisan schedule:run --verbose --no-interaction &); sleep 60; done"
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
numprocs=1
|
||||||
|
user=laradock
|
||||||
|
redirect_stderr=true
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
[program:laravel-worker]
|
||||||
|
process_name=%(program_name)s_%(process_num)02d
|
||||||
|
command=php /var/www/artisan queue:work --sleep=3 --tries=3
|
||||||
|
autostart=true
|
||||||
|
autorestart=true
|
||||||
|
numprocs=8
|
||||||
|
user=laradock
|
||||||
|
redirect_stderr=true
|
||||||
14
docker/redis/Dockerfile
Normal file
14
docker/redis/Dockerfile
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
FROM redis:latest
|
||||||
|
|
||||||
|
LABEL maintainer="Ludovic CANDELLIER <ludo@huma.net>"
|
||||||
|
|
||||||
|
## For security settings uncomment, make the dir, copy conf, and also start with the conf, to use it
|
||||||
|
RUN mkdir -p /usr/local/etc/redis
|
||||||
|
COPY redis.conf /usr/local/etc/redis/redis.conf
|
||||||
|
|
||||||
|
VOLUME /data
|
||||||
|
|
||||||
|
EXPOSE 6379
|
||||||
|
|
||||||
|
CMD ["redis-server", "/usr/local/etc/redis/redis.conf"]
|
||||||
|
# CMD ["redis-server"]
|
||||||
1377
docker/redis/redis.conf
Normal file
1377
docker/redis/redis.conf
Normal file
File diff suppressed because it is too large
Load Diff
37
docker/smtp/Dockerfile
Normal file
37
docker/smtp/Dockerfile
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
FROM debian:stable-slim
|
||||||
|
# FROM bitnami/minideb:latest
|
||||||
|
|
||||||
|
LABEL maintainer="Ludovic CANDELLIER <ludo@huma.net>"
|
||||||
|
|
||||||
|
# Set Environment Variables
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
|
# Start as root
|
||||||
|
USER root
|
||||||
|
|
||||||
|
# always run apt update when start and after add new source list, then clean up at end.
|
||||||
|
RUN apt-get update -yqq; \
|
||||||
|
apt-get upgrade -yqq; \
|
||||||
|
apt-get -yqq install --no-install-recommends apt-utils procps rsyslog apt-transport-https lsb-release ca-certificates curl wget \
|
||||||
|
logrotate postfix
|
||||||
|
|
||||||
|
COPY ./conf/main.cf /etc/postfix/main.cf
|
||||||
|
|
||||||
|
# RUN ln -snf /etc/services /var/spool/postfix/etc/services
|
||||||
|
|
||||||
|
COPY run.sh /
|
||||||
|
RUN chmod +x /run.sh
|
||||||
|
|
||||||
|
RUN /etc/init.d/postfix start
|
||||||
|
|
||||||
|
# Clean up
|
||||||
|
RUN apt-get clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
|
||||||
|
rm /var/log/lastlog /var/log/faillog
|
||||||
|
|
||||||
|
# CMD ["/bin/bash", "/run.sh"]
|
||||||
|
|
||||||
|
# Set default work directory
|
||||||
|
WORKDIR /var
|
||||||
|
|
||||||
|
EXPOSE 25
|
||||||
50
docker/smtp/conf/main.cf
Normal file
50
docker/smtp/conf/main.cf
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
# See /usr/share/postfix/main.cf.dist for a commented, more complete version
|
||||||
|
|
||||||
|
|
||||||
|
# Debian specific: Specifying a file name will cause the first
|
||||||
|
# line of that file to be used as the name. The Debian default
|
||||||
|
# is /etc/mailname.
|
||||||
|
#myorigin = /etc/mailname
|
||||||
|
myorigin = $mydomain
|
||||||
|
|
||||||
|
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
|
||||||
|
biff = no
|
||||||
|
|
||||||
|
# appending .domain is the MUA's job.
|
||||||
|
append_dot_mydomain = no
|
||||||
|
|
||||||
|
# Uncomment the next line to generate "delayed mail" warnings
|
||||||
|
#delay_warning_time = 4h
|
||||||
|
|
||||||
|
readme_directory = no
|
||||||
|
|
||||||
|
# See http://www.postfix.org/COMPATIBILITY_README.html -- default to 2 on
|
||||||
|
# fresh installs.
|
||||||
|
compatibility_level = 2
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# TLS parameters
|
||||||
|
smtpd_tls_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
|
||||||
|
smtpd_tls_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
|
||||||
|
smtpd_tls_security_level=may
|
||||||
|
|
||||||
|
smtp_tls_CApath=/etc/ssl/certs
|
||||||
|
smtp_tls_security_level=may
|
||||||
|
smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache
|
||||||
|
smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated defer_unauth_destination
|
||||||
|
|
||||||
|
alias_maps = hash:/etc/aliases
|
||||||
|
alias_database = hash:/etc/aliases
|
||||||
|
|
||||||
|
mailbox_size_limit = 0
|
||||||
|
recipient_delimiter = +
|
||||||
|
inet_interfaces = all
|
||||||
|
inet_protocols = all
|
||||||
|
|
||||||
|
myhostname = digital.opensem.com
|
||||||
|
mydomain = opensem.com
|
||||||
|
mydestination = $myhostname, localhost, digital.opensem.com
|
||||||
|
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128 172.16.0.0/12
|
||||||
|
|
||||||
|
maillog_file = /var/log/mail.log
|
||||||
8
docker/smtp/run.sh
Normal file
8
docker/smtp/run.sh
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# service postfix start
|
||||||
|
|
||||||
|
# exec /usr/sbin/postconf maillog_file=/var/log/postfix.log
|
||||||
|
# exec /usr/sbin/postfix -c /etc/postfix start-fg
|
||||||
|
/etc/init.d/postfix start
|
||||||
|
|
||||||
0
docker/workspace/.npmrc
Normal file
0
docker/workspace/.npmrc
Normal file
180
docker/workspace/Dockerfile
Normal file
180
docker/workspace/Dockerfile
Normal file
@@ -0,0 +1,180 @@
|
|||||||
|
FROM debian:stable-slim
|
||||||
|
# FROM bitnami/minideb:latest
|
||||||
|
|
||||||
|
LABEL maintainer="Ludovic CANDELLIER <ludo@huma.net>"
|
||||||
|
|
||||||
|
# Set Environment Variables
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
|
# Start as root
|
||||||
|
USER root
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
# Laradock non-root user:
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
# Add a non-root user to prevent files being created with root permissions on host machine.
|
||||||
|
ARG PUID=1000
|
||||||
|
ENV PUID ${PUID}
|
||||||
|
ARG PGID=1000
|
||||||
|
ENV PGID ${PGID}
|
||||||
|
|
||||||
|
RUN groupadd -g ${PGID} laradock; \
|
||||||
|
useradd -l -u ${PUID} -g laradock -m laradock; \
|
||||||
|
usermod -p "*" laradock -s /bin/bash;
|
||||||
|
|
||||||
|
# always run apt update when start and after add new source list, then clean up at end.
|
||||||
|
RUN apt-get update -yqq; \
|
||||||
|
apt-get upgrade -yqq; \
|
||||||
|
apt-get -yqq install --no-install-recommends apt-transport-https lsb-release tzdata ca-certificates curl wget \
|
||||||
|
apt-utils libzip-dev joe zip unzip rsync openssh-client git mc bzip2 nano default-mysql-client supervisor inetutils-ping mydumper \
|
||||||
|
wkhtmltopdf ghostscript jpegoptim optipng pngquant gifsicle chromium chromium-sandbox
|
||||||
|
|
||||||
|
COPY ./apt_sources/php.list /etc/apt/sources.list.d/php.list
|
||||||
|
|
||||||
|
RUN wget -O /etc/apt/trusted.gpg.d/php.gpg https://packages.sury.org/php/apt.gpg;
|
||||||
|
|
||||||
|
RUN apt-get update -yqq; \
|
||||||
|
apt install -yqq --no-install-recommends php8.0-apcu php8.0-bcmath php8.0-bz2 php8.0-cli php8.0-common php8.0-curl php8.0-dev php8.0-gd php8.0-igbinary php8.0-imagick \
|
||||||
|
php8.0-intl php8.0-mbstring php8.0-mcrypt php8.0-mysql php8.0-opcache php8.0-readline php8.0-redis php8.0-sqlite3 php8.0-tidy php8.0-uuid php8.0-xml php8.0-yaml php8.0-zip
|
||||||
|
|
||||||
|
RUN apt-get install -yqq --no-install-recommends nodejs npm python2
|
||||||
|
|
||||||
|
RUN update-alternatives --install /usr/bin/python python /usr/bin/python2 1
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
# Set Timezone
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
ARG TZ=UTC
|
||||||
|
ENV TZ ${TZ}
|
||||||
|
|
||||||
|
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
|
||||||
|
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
# Composer:
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
# Install composer and add its bin to the PATH.
|
||||||
|
RUN curl -s http://getcomposer.org/installer | php \
|
||||||
|
&& echo "export PATH=${PATH}:/var/www/vendor/bin" >> ~/.bashrc \
|
||||||
|
&& mv composer.phar /usr/local/bin/composer
|
||||||
|
|
||||||
|
# Export composer vendor path
|
||||||
|
RUN echo "" >> ~/.bashrc && \
|
||||||
|
echo 'export PATH="$HOME/.composer/vendor/bin:$PATH"' >> ~/.bashrc
|
||||||
|
|
||||||
|
# Update composer
|
||||||
|
ARG COMPOSER_VERSION=2
|
||||||
|
ENV COMPOSER_VERSION ${COMPOSER_VERSION}
|
||||||
|
RUN set -eux; \
|
||||||
|
if [ "$COMPOSER_VERSION" = "1" ] || [ "$COMPOSER_VERSION" = "2" ]; then \
|
||||||
|
composer self-update --${COMPOSER_VERSION}; \
|
||||||
|
else \
|
||||||
|
composer self-update ${COMPOSER_VERSION}; \
|
||||||
|
fi
|
||||||
|
|
||||||
|
USER laradock
|
||||||
|
|
||||||
|
# Export composer vendor path
|
||||||
|
RUN echo "" >> ~/.bashrc && \
|
||||||
|
echo 'export PATH="~/.composer/vendor/bin:$PATH"' >> ~/.bashrc
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
# Non-root user : PHPUnit path
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
# add ./vendor/bin to non-root user's bashrc (needed for phpunit)
|
||||||
|
USER laradock
|
||||||
|
|
||||||
|
RUN echo "" >> ~/.bashrc && \
|
||||||
|
echo 'export PATH="/var/www/vendor/bin:$PATH"' >> ~/.bashrc
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
# Crontab
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
COPY ./crontab /etc/cron.d
|
||||||
|
|
||||||
|
RUN chmod -R 644 /etc/cron.d
|
||||||
|
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
# YARN:
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
USER laradock
|
||||||
|
|
||||||
|
RUN curl -o- -L https://yarnpkg.com/install.sh | bash; \
|
||||||
|
echo "" >> ~/.bashrc && \
|
||||||
|
echo 'export PATH="$HOME/.yarn/bin:$PATH"' >> ~/.bashrc
|
||||||
|
|
||||||
|
# Add YARN binaries to root's .bashrc
|
||||||
|
USER root
|
||||||
|
|
||||||
|
RUN echo "" >> ~/.bashrc && \
|
||||||
|
echo 'export YARN_DIR="/home/laradock/.yarn"' >> ~/.bashrc && \
|
||||||
|
echo 'export PATH="$YARN_DIR/bin:$PATH"' >> ~/.bashrc
|
||||||
|
|
||||||
|
# Add PATH for YARN
|
||||||
|
ENV PATH $PATH:/home/laradock/.yarn/bin
|
||||||
|
|
||||||
|
|
||||||
|
RUN npm install -g grunt-cli
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
# SUPERVISOR:
|
||||||
|
###########################################################################
|
||||||
|
ARG INSTALL_SUPERVISOR=false
|
||||||
|
|
||||||
|
RUN if [ ${INSTALL_SUPERVISOR} = true ]; then \
|
||||||
|
if [ ${INSTALL_PYTHON} = true ]; then \
|
||||||
|
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 \
|
||||||
|
;fi
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
# GIT:
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
# RUN git --global config pull.ff only
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
# PM2:
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
RUN npm install -g pm2
|
||||||
|
|
||||||
|
###########################################################################
|
||||||
|
# Check PHP version:
|
||||||
|
###########################################################################
|
||||||
|
|
||||||
|
RUN set -xe; php -v | head -n 1 | grep -q "PHP 8.0."
|
||||||
|
|
||||||
|
#
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
# Final Touch
|
||||||
|
#--------------------------------------------------------------------------
|
||||||
|
#
|
||||||
|
|
||||||
|
USER root
|
||||||
|
|
||||||
|
# Clean up
|
||||||
|
RUN apt-get clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
|
||||||
|
rm /var/log/lastlog /var/log/faillog
|
||||||
|
|
||||||
|
# COPY ./supervisord/* /etc/supervisor/conf.d/
|
||||||
|
|
||||||
|
# Set default work directory
|
||||||
|
WORKDIR /var/www
|
||||||
|
|
||||||
|
USER laradock
|
||||||
150
docker/workspace/aliases.sh
Normal file
150
docker/workspace/aliases.sh
Normal file
@@ -0,0 +1,150 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
|
||||||
|
# Colors used for status updates
|
||||||
|
ESC_SEQ="\x1b["
|
||||||
|
COL_RESET=$ESC_SEQ"39;49;00m"
|
||||||
|
COL_RED=$ESC_SEQ"31;01m"
|
||||||
|
COL_GREEN=$ESC_SEQ"32;01m"
|
||||||
|
COL_YELLOW=$ESC_SEQ"33;01m"
|
||||||
|
COL_BLUE=$ESC_SEQ"34;01m"
|
||||||
|
COL_MAGENTA=$ESC_SEQ"35;01m"
|
||||||
|
COL_CYAN=$ESC_SEQ"36;01m"
|
||||||
|
|
||||||
|
# Detect which `ls` flavor is in use
|
||||||
|
if ls --color > /dev/null 2>&1; then # GNU `ls`
|
||||||
|
colorflag="--color"
|
||||||
|
export LS_COLORS='no=00:fi=00:di=01;31:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:'
|
||||||
|
else # macOS `ls`
|
||||||
|
colorflag="-G"
|
||||||
|
export LSCOLORS='BxBxhxDxfxhxhxhxhxcxcx'
|
||||||
|
fi
|
||||||
|
|
||||||
|
# List all files colorized in long format
|
||||||
|
#alias l="ls -lF ${colorflag}"
|
||||||
|
### MEGA: I want l and la ti return hisdden files
|
||||||
|
alias l="ls -laF ${colorflag}"
|
||||||
|
|
||||||
|
# List all files colorized in long format, including dot files
|
||||||
|
alias la="ls -laF ${colorflag}"
|
||||||
|
|
||||||
|
# List only directories
|
||||||
|
alias lsd="ls -lF ${colorflag} | grep --color=never '^d'"
|
||||||
|
|
||||||
|
# Always use color output for `ls`
|
||||||
|
alias ls="command ls ${colorflag}"
|
||||||
|
|
||||||
|
# Commonly Used Aliases
|
||||||
|
alias ..="cd .."
|
||||||
|
alias ...="cd ../.."
|
||||||
|
alias ....="cd ../../.."
|
||||||
|
alias .....="cd ../../../.."
|
||||||
|
alias ~="cd ~" # `cd` is probably faster to type though
|
||||||
|
alias -- -="cd -"
|
||||||
|
alias home="cd ~"
|
||||||
|
|
||||||
|
alias h="history"
|
||||||
|
alias j="jobs"
|
||||||
|
alias e='exit'
|
||||||
|
alias c="clear"
|
||||||
|
alias cla="clear && ls -la"
|
||||||
|
alias cll="clear && ls -l"
|
||||||
|
alias cls="clear && ls"
|
||||||
|
alias code="cd /var/www"
|
||||||
|
alias ea="vi ~/aliases.sh"
|
||||||
|
|
||||||
|
# Always enable colored `grep` output
|
||||||
|
# Note: `GREP_OPTIONS="--color=auto"` is deprecated, hence the alias usage.
|
||||||
|
alias grep='grep --color=auto'
|
||||||
|
alias fgrep='fgrep --color=auto'
|
||||||
|
alias egrep='egrep --color=auto'
|
||||||
|
|
||||||
|
alias art="php artisan"
|
||||||
|
alias artisan="php artisan"
|
||||||
|
alias cdump="composer dump-autoload -o"
|
||||||
|
alias composer:dump="composer dump-autoload -o"
|
||||||
|
alias db:reset="php artisan migrate:reset && php artisan migrate --seed"
|
||||||
|
alias dusk="php artisan dusk"
|
||||||
|
alias fresh="php artisan migrate:fresh"
|
||||||
|
alias migrate="php artisan migrate"
|
||||||
|
alias refresh="php artisan migrate:refresh"
|
||||||
|
alias rollback="php artisan migrate:rollback"
|
||||||
|
alias seed="php artisan db:seed"
|
||||||
|
alias serve="php artisan serve --quiet &"
|
||||||
|
|
||||||
|
alias phpunit="./vendor/bin/phpunit"
|
||||||
|
alias pu="phpunit"
|
||||||
|
alias puf="phpunit --filter"
|
||||||
|
alias pud='phpunit --debug'
|
||||||
|
|
||||||
|
alias cc='codecept'
|
||||||
|
alias ccb='codecept build'
|
||||||
|
alias ccr='codecept run'
|
||||||
|
alias ccu='codecept run unit'
|
||||||
|
alias ccf='codecept run functional'
|
||||||
|
|
||||||
|
alias g="gulp"
|
||||||
|
alias npm-global="npm list -g --depth 0"
|
||||||
|
alias ra="reload"
|
||||||
|
alias reload="source ~/.aliases && echo \"$COL_GREEN ==> Aliases Reloaded... $COL_RESET \n \""
|
||||||
|
alias run="npm run"
|
||||||
|
|
||||||
|
# Xvfb
|
||||||
|
alias xvfb="Xvfb -ac :0 -screen 0 1024x768x16 &"
|
||||||
|
|
||||||
|
# requires installation of 'https://www.npmjs.com/package/npms-cli'
|
||||||
|
alias npms="npms search"
|
||||||
|
# requires installation of 'https://www.npmjs.com/package/package-menu-cli'
|
||||||
|
alias pm="package-menu"
|
||||||
|
# requires installation of 'https://www.npmjs.com/package/pkg-version-cli'
|
||||||
|
alias pv="package-version"
|
||||||
|
# requires installation of 'https://github.com/sindresorhus/latest-version-cli'
|
||||||
|
alias lv="latest-version"
|
||||||
|
|
||||||
|
# git aliases
|
||||||
|
alias gaa="git add ."
|
||||||
|
alias gd="git --no-pager diff"
|
||||||
|
alias git-revert="git reset --hard && git clean -df"
|
||||||
|
alias gs="git status"
|
||||||
|
alias whoops="git reset --hard && git clean -df"
|
||||||
|
alias glog="git log --oneline --decorate --graph"
|
||||||
|
alias gloga="git log --oneline --decorate --graph --all"
|
||||||
|
alias gsh="git show"
|
||||||
|
alias grb="git rebase -i"
|
||||||
|
alias gbr="git branch"
|
||||||
|
alias gc="git commit"
|
||||||
|
alias gck="git checkout"
|
||||||
|
|
||||||
|
# Create a new directory and enter it
|
||||||
|
function mkd() {
|
||||||
|
mkdir -p "$@" && cd "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
function md() {
|
||||||
|
mkdir -p "$@" && cd "$@"
|
||||||
|
}
|
||||||
|
|
||||||
|
function xtree {
|
||||||
|
find ${1:-.} -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g'
|
||||||
|
}
|
||||||
|
|
||||||
|
# `tre` is a shorthand for `tree` with hidden files and color enabled, ignoring
|
||||||
|
# the `.git` directory, listing directories first. The output gets piped into
|
||||||
|
# `less` with options to preserve color and line numbers, unless the output is
|
||||||
|
# small enough for one screen.
|
||||||
|
function tre() {
|
||||||
|
tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@" | less -FRNX;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Determine size of a file or total size of a directory
|
||||||
|
function fs() {
|
||||||
|
if du -b /dev/null > /dev/null 2>&1; then
|
||||||
|
local arg=-sbh;
|
||||||
|
else
|
||||||
|
local arg=-sh;
|
||||||
|
fi
|
||||||
|
if [[ -n "$@" ]]; then
|
||||||
|
du $arg -- "$@";
|
||||||
|
else
|
||||||
|
du $arg .[^.]* ./*;
|
||||||
|
fi;
|
||||||
|
}
|
||||||
1
docker/workspace/apt_sources/php.list
Normal file
1
docker/workspace/apt_sources/php.list
Normal file
@@ -0,0 +1 @@
|
|||||||
|
deb https://packages.sury.org/php/ bullseye main
|
||||||
5
docker/workspace/composer.json
Normal file
5
docker/workspace/composer.json
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
{
|
||||||
|
"require": {
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
1
docker/workspace/crontab/laradock
Normal file
1
docker/workspace/crontab/laradock
Normal file
@@ -0,0 +1 @@
|
|||||||
|
* * * * * laradock /usr/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1
|
||||||
Reference in New Issue
Block a user