Browse Source
+ php src container fully refactored and lightweight
+ 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 filemaster
dimti
1 week ago
77 changed files with 2227 additions and 3190 deletions
-
29.env.example
-
5.gitignore
-
24bash/xdebug-quit.sh
-
33bash/xdebug-start.sh
-
9config/dnsmasq/dnsmasq.conf.example
-
1config/redis/.gitignore
-
17config/redis/redis-local.conf.example
-
1278config/redis/redis.conf
-
1319config/redis/redis.conf.origin
-
3dc-nprm
-
38docker-compose.base.yml
-
9docker-compose.dnsmasq.yml.example
-
2docker-compose.elastic.yml.example
-
15docker-compose.gui-postgres.yml.example
-
2docker-compose.gui-redis.yml.example
-
14docker-compose.mariadb.yml.example
-
12docker-compose.minio.yml
-
2docker-compose.minio.yml.example
-
2docker-compose.nodejs.yml.example
-
14docker-compose.postgres.yml.example
-
2docker-compose.redis.yml.example
-
2docker-compose.sphinxsearch.yml.example
-
31docker-compose.yml.example
-
9dockerfiles/php-fpm/igbinary.ini
-
93dockerfiles/php-fpm/php.base.Dockerfile
-
43dockerfiles/php-fpm/php56.Dockerfile
-
63dockerfiles/php-fpm/php74.Dockerfile
-
67dockerfiles/php-fpm/php81.Dockerfile
-
59dockerfiles/php-fpm/php82.Dockerfile
-
7dockerfiles/php-fpm/php83.Dockerfile
-
87dockerfiles/php-fpm/xdebug2/xdebug.sh
-
84dockerfiles/php-fpm/xdebug3/xdebug.sh
-
6dockerfiles/workspace/.bash_aliases.example
-
3dockerfiles/workspace/.gitignore
-
1dockerfiles/workspace/crontab-example/laradock
-
1dockerfiles/workspace/crontab-examples/laradock
-
2dockerfiles/workspace/crontab/.gitignore
-
12dockerfiles/workspace/minio/auth.json
-
279dockerfiles/workspace/workspace.base.Dockerfile
-
170dockerfiles/workspace/workspace74.Dockerfile
-
130dockerfiles/workspace/workspace81.Dockerfile
-
114dockerfiles/workspace/workspace82.Dockerfile
-
7dockerfiles/workspace/workspace83.Dockerfile
-
73dockerfiles/workspace/xdebug.sh
-
45src/.env
-
26src/docker-compose.base.yml
-
30src/docker-compose.yml
-
145src/dockerfiles/php-fpm/php.base.Dockerfile
-
136src/dockerfiles/php-fpm/php.base56.Dockerfile
-
7src/dockerfiles/php-fpm/php56.Dockerfile
-
7src/dockerfiles/php-fpm/php74.Dockerfile
-
8src/dockerfiles/php-fpm/php81.Dockerfile
-
7src/dockerfiles/php-fpm/php82.Dockerfile
-
117src/dockerfiles/php/fpm/php.base.Dockerfile
-
19src/dockerfiles/php/fpm/php74.Dockerfile
-
9src/dockerfiles/php/fpm/php81.Dockerfile
-
8src/dockerfiles/php/fpm/php82.Dockerfile
-
8src/dockerfiles/php/fpm/php83.Dockerfile
-
0src/dockerfiles/php/workspace/artisan_bash_completion.sh
-
80src/dockerfiles/php/workspace/workspace.base.Dockerfile
-
6src/dockerfiles/php/workspace/workspace74.Dockerfile
-
6src/dockerfiles/php/workspace/workspace81.Dockerfile
-
6src/dockerfiles/php/workspace/workspace82.Dockerfile
-
9src/dockerfiles/php/workspace/workspace83.Dockerfile
-
6src/dockerfiles/php/workspace/xdebug2.Dockerfile
-
6src/dockerfiles/php/workspace/xdebug3.Dockerfile
-
2src/dockerfiles/php/xdebug2.ini
-
1src/dockerfiles/php/xdebug3.ini
-
153src/dockerfiles/workspace/aliases.sh
-
13src/dockerfiles/workspace/composer.Dockerfile
-
3src/dockerfiles/workspace/tmux.conf
-
298src/dockerfiles/workspace/workspace.base.Dockerfile
-
8src/dockerfiles/workspace/xdebug2.Dockerfile
-
23src/dockerfiles/workspace/xdebug2.ini
-
8src/dockerfiles/workspace/xdebug3.Dockerfile
-
3src/dockerfiles/workspace/xdebug3.ini
-
29src/quick/build-php.sh
@ -1,9 +1,6 @@ |
|||||
/.idea |
/.idea |
||||
/dockerfiles/ypt-encoder |
|
||||
|
/.env |
||||
/docker-compose* |
/docker-compose* |
||||
!/docker-compose.base.yml |
!/docker-compose.base.yml |
||||
!/docker-compose*.example |
!/docker-compose*.example |
||||
/docker-compose.nodejs.yml |
|
||||
/.env |
|
||||
/*.komodoproject |
|
||||
/config/nginx/includes.d/auth.passwd |
/config/nginx/includes.d/auth.passwd |
@ -1,9 +1,10 @@ |
|||||
#log all dns queries |
|
||||
|
# log all dns queries |
||||
log-queries |
log-queries |
||||
#dont use hosts nameservers |
|
||||
|
# dont use hosts nameservers |
||||
no-resolv |
no-resolv |
||||
#use google as default nameservers |
|
||||
|
# use google as default nameservers |
||||
server=8.8.4.4 |
server=8.8.4.4 |
||||
server=8.8.8.8 |
server=8.8.8.8 |
||||
#explicitly define host-ip mappings |
|
||||
|
# explicitly define host-ip mappings |
||||
|
# line below need real data |
||||
address=/domain/ip |
address=/domain/ip |
@ -0,0 +1 @@ |
|||||
|
/redis-local.conf |
@ -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 "" |
1278
config/redis/redis.conf
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
1319
config/redis/redis.conf.origin
File diff suppressed because it is too large
View File
File diff suppressed because it is too large
View File
@ -0,0 +1,3 @@ |
|||||
|
#!/bin/bash |
||||
|
# N - nginx; P - php; R - redis; M - mariadb |
||||
|
dc -f docker-compose.yml -f docker-compose.redis.yml -f docker-compose.mariadb.yml $@ |
@ -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 |
@ -1,5 +1,3 @@ |
|||||
version: '3.6' |
|
||||
|
|
||||
services: |
services: |
||||
redis-ui: |
redis-ui: |
||||
image: marian/rebrow |
image: marian/rebrow |
@ -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: |
@ -1,12 +0,0 @@ |
|||||
version: '3.6' |
|
||||
|
|
||||
services: |
|
||||
minio: |
|
||||
extends: |
|
||||
file: docker-compose.base.yml |
|
||||
service: minio |
|
||||
volumes: |
|
||||
- minio:/minio |
|
||||
|
|
||||
volumes: |
|
||||
minio: |
|
@ -0,0 +1,14 @@ |
|||||
|
services: |
||||
|
dbpg: |
||||
|
image: postgres |
||||
|
restart: always |
||||
|
environment: |
||||
|
POSTGRES_PASSWORD: postgres |
||||
|
volumes: |
||||
|
- databasepg:/var/lib/postgresql/data |
||||
|
- ./hostfiles:/hostfiles |
||||
|
ports: |
||||
|
- "5432:5432" |
||||
|
|
||||
|
volumes: |
||||
|
databasepg: |
@ -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 |
|
@ -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/* |
@ -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" |
|
@ -1,62 +1,7 @@ |
|||||
|
# syntax = edrevo/dockerfile-plus |
||||
FROM dimti/php:7.4 |
FROM dimti/php:7.4 |
||||
|
|
||||
########################################################################### |
|
||||
# Redis and igbinary: |
|
||||
########################################################################### |
|
||||
|
ARG PHP_VERSION=7.4 |
||||
|
ENV PHP_VERSION ${PHP_VERSION} |
||||
|
|
||||
ARG INSTALL_REDIS=false |
|
||||
|
|
||||
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" |
|
||||
|
INCLUDE+ ./php.base.Dockerfile |
@ -1,66 +1,7 @@ |
|||||
|
# syntax = edrevo/dockerfile-plus |
||||
FROM dimti/php:8.1 |
FROM dimti/php:8.1 |
||||
|
|
||||
########################################################################### |
|
||||
# Redis and igbinary: |
|
||||
########################################################################### |
|
||||
|
ARG PHP_VERSION=8.1 |
||||
|
ENV PHP_VERSION ${PHP_VERSION} |
||||
|
|
||||
ARG INSTALL_REDIS=false |
|
||||
|
|
||||
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 |
|
||||
|
|
||||
########################################################################### |
|
||||
# Libreoffice |
|
||||
########################################################################### |
|
||||
|
|
||||
ARG INSTALL_LIBREOFFICE=false |
|
||||
|
|
||||
ARG DEBIAN_FRONTEND=noninteractive |
|
||||
|
|
||||
RUN if [ ${INSTALL_LIBREOFFICE} = true ]; then \ |
|
||||
apt-get update \ |
|
||||
&& apt-get install -y libreoffice-nogui --no-install-recommends \ |
|
||||
&& apt-get clean \ |
|
||||
;fi |
|
||||
|
|
||||
########################################################################### |
|
||||
# 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" |
|
||||
|
INCLUDE+ ./php.base.Dockerfile |
@ -1,58 +1,7 @@ |
|||||
|
# syntax = edrevo/dockerfile-plus |
||||
FROM dimti/php:8.2 |
FROM dimti/php:8.2 |
||||
|
|
||||
########################################################################### |
|
||||
# Redis and igbinary: |
|
||||
########################################################################### |
|
||||
|
ARG PHP_VERSION=8.2 |
||||
|
ENV PHP_VERSION ${PHP_VERSION} |
||||
|
|
||||
ARG INSTALL_REDIS=false |
|
||||
|
|
||||
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" |
|
||||
|
|
||||
########################################################################### |
|
||||
# Libreoffice: |
|
||||
########################################################################### |
|
||||
|
|
||||
RUN apt-get update && apt-get install -y libreoffice-nogui --no-install-recommends && apt-get clean |
|
||||
|
INCLUDE+ ./php.base.Dockerfile |
@ -0,0 +1,7 @@ |
|||||
|
# syntax = edrevo/dockerfile-plus |
||||
|
FROM dimti/php:8.3 |
||||
|
|
||||
|
ARG PHP_VERSION=8.3 |
||||
|
ENV PHP_VERSION ${PHP_VERSION} |
||||
|
|
||||
|
INCLUDE+ ./php.base.Dockerfile |
@ -1,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 xDebug2' |
|
||||
|
|
||||
# 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 xDebug2' |
|
||||
|
|
||||
# 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 |
|
@ -1,84 +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 xDebug3' |
|
||||
|
|
||||
# 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 [[ -n "${WITH_PROFILER}" ]]; then |
|
||||
XDEBUG_MODE='profile' |
|
||||
else |
|
||||
XDEBUG_MODE='debug' |
|
||||
fi |
|
||||
|
|
||||
MODE_DEBUG_CMD="sed -i 's/^xdebug.mode.*/xdebug.mode=${XDEBUG_MODE}/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 xDebug3' |
|
||||
|
|
||||
# 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 |
|
@ -1,6 +0,0 @@ |
|||||
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' |
|
@ -1,3 +0,0 @@ |
|||||
/.bash_* |
|
||||
!/.bash_.example |
|
||||
/crontab |
|
@ -1 +0,0 @@ |
|||||
#* * * * * laradock /usr/bin/php /var/www/artisan schedule:run >> /dev/null 2>&1 |
|
@ -0,0 +1 @@ |
|||||
|
#* * * * * laradock /usr/bin/php /var/www/yourproject/artisan schedule:run >> /dev/null 2>&1 |
@ -0,0 +1,2 @@ |
|||||
|
* |
||||
|
!.gitignore |
@ -1,12 +0,0 @@ |
|||||
{ |
|
||||
"version": "10", |
|
||||
"aliases": { |
|
||||
"local": { |
|
||||
"url": "http://minio:9000", |
|
||||
"accessKey": "s3.local", |
|
||||
"secretKey": "qbKTLqAumjYOYlCXCRk6", |
|
||||
"api": "S3v4", |
|
||||
"path": "auto" |
|
||||
} |
|
||||
} |
|
||||
} |
|
@ -0,0 +1,279 @@ |
|||||
|
########################################################################### |
||||
|
# 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 |
||||
|
|
||||
|
########################################################################### |
||||
|
# APT |
||||
|
########################################################################### |
||||
|
|
||||
|
# 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 |
||||
|
|
||||
|
RUN if [ ${INSTALL_FINE_UTILS} = true ]; then \ |
||||
|
apt-get install htop -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"] |
@ -1,171 +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} |
||||
|
|
||||
########################################################################### |
|
||||
# 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} |
|
||||
|
|
||||
########################################################################### |
|
||||
# YADM |
|
||||
########################################################################### |
|
||||
|
|
||||
USER root |
|
||||
|
|
||||
SHELL ["/bin/bash", "-c"] |
|
||||
|
|
||||
# once please |
|
||||
RUN apt update |
|
||||
|
|
||||
RUN apt install -y direnv yadm |
|
||||
RUN curl -sS https://starship.rs/install.sh | sh -s -- -f |
|
||||
|
|
||||
USER laradock |
|
||||
|
|
||||
RUN yadm clone --bootstrap https://vcs.wpstudio.ru/gitea/dotfiles.git |
|
||||
|
|
||||
RUN sed -i 's/#/\\$/g' ${HOME}/.config/starship.toml |
|
||||
|
|
||||
########################################################################### |
|
||||
# SUPERVISOR: |
|
||||
########################################################################### |
|
||||
|
|
||||
USER root |
|
||||
|
|
||||
ARG INSTALL_SUPERVISOR=false |
|
||||
|
|
||||
RUN if [ ${INSTALL_SUPERVISOR} = true ]; then \ |
|
||||
apt install -y supervisor \ |
|
||||
;fi |
|
||||
|
|
||||
RUN apt install -y liblzma-dev libbz2-dev libffi-dev libreadline-dev |
|
||||
|
|
||||
USER laradock |
|
||||
|
|
||||
RUN curl https://pyenv.run | bash |
|
||||
|
|
||||
RUN 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 |
|
||||
|
|
||||
RUN $HOME/.pyenv/bin/pyenv install 3.9 |
|
||||
|
|
||||
ARG INSTALL_PYTHON=false |
|
||||
|
|
||||
RUN if [ ${INSTALL_PYTHON} = true ]; then \ |
|
||||
export PYENV_VERSION=3.9 && \ |
|
||||
python -m pip install uvicorn \ |
|
||||
;fi |
|
||||
|
|
||||
RUN if [ false = true ]; then \ |
|
||||
export PYENV_VERSION=3.9 && \ |
|
||||
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 |
|
||||
|
|
||||
USER root |
|
||||
|
|
||||
RUN apt install -y htop |
|
||||
|
|
||||
########################################################################### |
|
||||
# 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 |
|
||||
|
|
||||
# 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"] |
|
||||
|
INCLUDE+ ./workspace.base.Dockerfile |
@ -1,127 +1,7 @@ |
|||||
FROM dimti/workspace:8.1 |
|
||||
|
# syntax = edrevo/dockerfile-plus |
||||
|
FROM dimti/workspace:8.2 |
||||
|
|
||||
ARG PHP_VERSION=8.1 |
|
||||
|
ARG PHP_VERSION=8.2 |
||||
|
ENV PHP_VERSION ${PHP_VERSION} |
||||
|
|
||||
########################################################################### |
|
||||
# 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: |
|
||||
########################################################################### |
|
||||
|
|
||||
ARG INSTALL_REDIS=false |
|
||||
|
|
||||
#RUN pecl install igbinary |
|
||||
|
|
||||
RUN if [ ${INSTALL_REDIS} = true ]; then \ |
|
||||
pecl install -a redis \ |
|
||||
echo "extension=redis.so" > /etc/php/${PHP_VERSION}/cli/conf.d/20-redis.ini \ |
|
||||
;fi |
|
||||
|
|
||||
########################################################################### |
|
||||
# Libreoffice |
|
||||
########################################################################### |
|
||||
|
|
||||
ARG INSTALL_LIBREOFFICE=false |
|
||||
|
|
||||
ARG DEBIAN_FRONTEND=noninteractive |
|
||||
|
|
||||
RUN if [ ${INSTALL_LIBREOFFICE} = true ]; then \ |
|
||||
add-apt-repository ppa:libreoffice/ppa \ |
|
||||
&& apt update \ |
|
||||
&& apt install libreoffice-nogui -y --no-install-recommends \ |
|
||||
&& apt clean \ |
|
||||
;fi |
|
||||
|
|
||||
########################################################################### |
|
||||
# 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 |
|
||||
|
INCLUDE+ ./workspace.base.Dockerfile |
@ -1,115 +1,7 @@ |
|||||
|
# syntax = edrevo/dockerfile-plus |
||||
FROM dimti/workspace:8.2 |
FROM dimti/workspace:8.2 |
||||
|
|
||||
ARG PHP_VERSION=8.2 |
ARG PHP_VERSION=8.2 |
||||
|
ENV PHP_VERSION ${PHP_VERSION} |
||||
|
|
||||
########################################################################### |
|
||||
# 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 |
|
||||
|
|
||||
########################################################################### |
|
||||
# Libreoffice: |
|
||||
########################################################################### |
|
||||
|
|
||||
ARG DEBIAN_FRONTEND=noninteractive |
|
||||
RUN add-apt-repository ppa:libreoffice/ppa && apt update && apt install libreoffice-nogui -y --no-install-recommends && apt clean |
|
||||
|
INCLUDE+ ./workspace.base.Dockerfile |
@ -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 |
@ -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,33 +1,26 @@ |
|||||
|
### PHP COMMON ############################################# |
||||
|
INSTALL_XDEBUG==true |
||||
|
INSTALL_OPCACHE=true |
||||
|
INSTALL_REDIS=true |
||||
|
|
||||
### WORKSPACE ############################################# |
### WORKSPACE ############################################# |
||||
WORKSPACE_PUID=1000 |
|
||||
WORKSPACE_PGID=1000 |
|
||||
WORKSPACE_TIMEZONE=Europe/Moscow |
|
||||
WORKSPACE_INSTALL_SSH=true |
|
||||
WORKSPACE_INSTALL_MYSQL_CLIENT=true |
|
||||
WORKSPACE_INSTALL_FSWATCH=false |
|
||||
WORKSPACE_INSTALL_PING=true |
|
||||
WORKSPACE_INSTALL_S3_MINIO_CLIENT=false |
|
||||
WORKSPACE_INSTALL_BZ2=true |
|
||||
# PHP-extensions already installed: INTL, PGSQL, BCMATH |
|
||||
|
# Workspace based on Ubuntu: https://github.com/phusion/baseimage-docker/blob/master/image/Dockerfile |
||||
|
# Ubuntu release: https://releases.ubuntu.com |
||||
|
|
||||
|
# PHP-extensions already installed: PDO (COMMON), INTL, MYSQL, PGSQL, ZIP, BCMATH etcetera |
||||
|
# See https://github.com/laradock/workspace/blob/master/Dockerfile-8.2 |
||||
|
# php-common modules: https://packages.debian.org/sid/i386/php8.2-common/filelist |
||||
|
# opcache module installed automatic (not from php-common, but from php by default) and not needed for cli) |
||||
|
|
||||
WORKSPACE_INSTALL_WP_CLI=true |
WORKSPACE_INSTALL_WP_CLI=true |
||||
WORKSPACE_INSTALL_NODE=true |
|
||||
WORKSPACE_INSTALL_GULP=false |
|
||||
WORKSPACE_INSTALL_YARN=true |
|
||||
WORKSPACE_NODE_VERSION=lts/hydrogen |
|
||||
WORKSPACE_NPM_REGISTRY= |
|
||||
WORKSPACE_YARN_VERSION=latest |
|
||||
|
WORKSPACE_INSTALL_NVM=true |
||||
|
|
||||
### PHP-FPM ############################################# |
### PHP-FPM ############################################# |
||||
INSTALL_XDEBUG=true |
|
||||
INSTALL_REDIS=true |
|
||||
INSTALL_ZIP=true |
|
||||
INSTALL_BZ2=true |
|
||||
INSTALL_OPCACHE=true |
|
||||
INSTALL_INTL=true |
|
||||
INSTALL_PGSQL=true |
|
||||
INSTALL_BCMATH=true |
|
||||
|
# PHP-FPM based on Debian: https://github.com/devilbox/docker-php-fpm-8.2/blob/master/Dockerfiles/Dockerfile |
||||
|
# Debian releases: https://www.debian.org/releases/ |
||||
|
|
||||
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_UPLOAD_MAX_FILESIZE=16M |
|
||||
|
PHP_OPT_POST_MAX_SIZE=200M |
||||
|
PHP_OPT_UPLOAD_MAX_FILESIZE=90M |
||||
|
|
@ -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} |
|
@ -1,45 +1,49 @@ |
|||||
version: '3.6' |
|
||||
|
|
||||
services: |
services: |
||||
php56: |
|
||||
|
php74: |
||||
extends: |
extends: |
||||
file: docker-compose.base.yml |
file: docker-compose.base.yml |
||||
service: php-fpm |
service: php-fpm |
||||
build: |
build: |
||||
dockerfile: php56.Dockerfile |
|
||||
php74: |
|
||||
|
dockerfile: fpm/php74.Dockerfile |
||||
|
php81: |
||||
extends: |
extends: |
||||
file: docker-compose.base.yml |
file: docker-compose.base.yml |
||||
service: php-fpm |
service: php-fpm |
||||
build: |
build: |
||||
dockerfile: php74.Dockerfile |
|
||||
php81: |
|
||||
|
dockerfile: fpm/php81.Dockerfile |
||||
|
php82: |
||||
extends: |
extends: |
||||
file: docker-compose.base.yml |
file: docker-compose.base.yml |
||||
service: php-fpm |
service: php-fpm |
||||
build: |
build: |
||||
dockerfile: php81.Dockerfile |
|
||||
php82: |
|
||||
|
dockerfile: fpm/php82.Dockerfile |
||||
|
php83: |
||||
extends: |
extends: |
||||
file: docker-compose.base.yml |
file: docker-compose.base.yml |
||||
service: php-fpm |
service: php-fpm |
||||
build: |
build: |
||||
dockerfile: php82.Dockerfile |
|
||||
|
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: |
workspace82: |
||||
extends: |
extends: |
||||
file: docker-compose.base.yml |
file: docker-compose.base.yml |
||||
service: workspace |
service: workspace |
||||
build: |
build: |
||||
dockerfile: workspace82.Dockerfile |
|
||||
|
dockerfile: workspace/workspace82.Dockerfile |
||||
|
workspace83: |
||||
|
extends: |
||||
|
file: docker-compose.base.yml |
||||
|
service: workspace |
||||
|
build: |
||||
|
dockerfile: workspace/workspace83.Dockerfile |
@ -1,145 +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 \ |
|
||||
if [ $(php -r "echo PHP_MINOR_VERSION;") = "1" ]; then \ |
|
||||
pecl install xdebug-3.1.6; \ |
|
||||
elif [ $(php -r "echo PHP_MINOR_VERSION;") = "2" ]; then \ |
|
||||
pecl install xdebug-3.3.1; \ |
|
||||
else \ |
|
||||
pecl install xdebug; \ |
|
||||
fi \ |
|
||||
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" |
|
@ -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" |
|
@ -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 |
|
@ -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 |
|
@ -1,8 +0,0 @@ |
|||||
# syntax = edrevo/dockerfile-plus |
|
||||
# https://github.com/docker-library/php/blob/52062af5056d0cd91fa5ded64fad8f9c82847b49/8.1/bookworm/fpm/Dockerfile |
|
||||
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 |
|
@ -1,7 +0,0 @@ |
|||||
# syntax = edrevo/dockerfile-plus |
|
||||
FROM php:8.2-fpm |
|
||||
|
|
||||
INCLUDE+ ./php.base.Dockerfile |
|
||||
|
|
||||
RUN docker-php-ext-configure gd --with-freetype --with-jpeg --with-webp \ |
|
||||
&& docker-php-ext-install -j$(nproc) gd |
|
@ -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 pecl install -a 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 |
@ -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 |
||||
|
|
||||
|
|
||||
|
|
@ -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} |
@ -0,0 +1,8 @@ |
|||||
|
# syntax = edrevo/dockerfile-plus |
||||
|
FROM php:8.2-fpm |
||||
|
|
||||
|
INCLUDE+ ./fpm/php.base.Dockerfile |
||||
|
|
||||
|
ARG XDEBUG_INI_PATH=/usr/local/etc/php/conf.d/xdebug.ini |
||||
|
|
||||
|
COPY ./xdebug3.ini ${XDEBUG_INI_PATH} |
@ -0,0 +1,8 @@ |
|||||
|
# syntax = edrevo/dockerfile-plus |
||||
|
FROM php:8.3-fpm |
||||
|
|
||||
|
INCLUDE+ ./fpm/php.base.Dockerfile |
||||
|
|
||||
|
ARG XDEBUG_INI_PATH=/usr/local/etc/php/conf.d/xdebug.ini |
||||
|
|
||||
|
COPY ./xdebug3.ini ${XDEBUG_INI_PATH} |
@ -0,0 +1,80 @@ |
|||||
|
########################################################################### |
||||
|
# Laradock non-root user: |
||||
|
########################################################################### |
||||
|
|
||||
|
# Thath might be changed in structure/dockerfiles and structure/.env |
||||
|
ARG PUID=1000 |
||||
|
ARG PGID=1000 |
||||
|
|
||||
|
# For more infromation about set command: See https://www.gnu.org/software/bash/manual/html_node/The-Set-Builtin.html |
||||
|
# RUN set -xe |
||||
|
|
||||
|
RUN groupadd -g ${PGID} laradock && \ |
||||
|
useradd -u ${PUID} -g laradock -m laradock -G docker_env && \ |
||||
|
usermod -p "*" laradock -s /bin/bash |
||||
|
|
||||
|
ARG DEBIAN_FRONTEND=noninteractive |
||||
|
ARG DEBCONF_NOWARNINGS=yes |
||||
|
|
||||
|
RUN apt -qq update && \ |
||||
|
apt-get install tmux bash-completion inetutils-ping -qq |
||||
|
|
||||
|
########################################################################### |
||||
|
# Install PHP-extensions: |
||||
|
########################################################################### |
||||
|
|
||||
|
ARG EXTS=(bz2) |
||||
|
|
||||
|
SHELL ["/bin/bash", "-c"] |
||||
|
RUN for EXT in ${EXTS[@]}; do apt-get install -qq php${PHP_VERSION}-${EXT}; done |
||||
|
SHELL ["/bin/sh", "-c"] |
||||
|
|
||||
|
########################################################################### |
||||
|
# 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 && \ |
||||
|
echo ';zend_extension=xdebug.so' > /etc/php/${PHP_VERSION}/cli/conf.d/20-xdebug.ini |
||||
|
|
||||
|
########################################################################### |
||||
|
# Redis: |
||||
|
########################################################################### |
||||
|
|
||||
|
RUN pecl install -a redis && \ |
||||
|
echo "extension=redis.so" > /etc/php/${PHP_VERSION}/cli/conf.d/20-redis.ini |
||||
|
|
||||
|
########################################################################### |
||||
|
# Check PHP version: |
||||
|
########################################################################### |
||||
|
|
||||
|
RUN php -v | head -n 1 | grep -q "PHP ${PHP_VERSION}." |
||||
|
|
||||
|
########################################################################### |
||||
|
# Tune opts: |
||||
|
########################################################################### |
||||
|
|
||||
|
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 |
||||
|
|
||||
|
# |
||||
|
#-------------------------------------------------------------------------- |
||||
|
# Final Touch |
||||
|
#-------------------------------------------------------------------------- |
||||
|
# |
||||
|
|
||||
|
# Clean up |
||||
|
RUN apt clean && \ |
||||
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ |
||||
|
rm /var/log/lastlog /var/log/faillog |
||||
|
|
||||
|
# Set default work directory |
||||
|
WORKDIR /var/www |
@ -0,0 +1,9 @@ |
|||||
|
# syntax = edrevo/dockerfile-plus |
||||
|
FROM laradock/workspace:latest-8.3 |
||||
|
|
||||
|
ARG PHP_VERSION=8.3 |
||||
|
ENV PHP_VERSION ${PHP_VERSION} |
||||
|
|
||||
|
INCLUDE+ ./workspace/workspace.base.Dockerfile |
||||
|
|
||||
|
INCLUDE+ ./workspace/xdebug3.Dockerfile |
@ -0,0 +1,6 @@ |
|||||
|
ARG XDEBUG_INI_PATH=/etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini |
||||
|
|
||||
|
COPY ./xdebug2.ini ${XDEBUG_INI_PATH} |
||||
|
|
||||
|
RUN sed -i "s/^;xdebug.remote_host/xdebug.remote_host/g" ${XDEBUG_INI_PATH} && \ |
||||
|
sed -i "s/^xdebug.remote_connect_back/;xdebug.remote_connect_back/g" ${XDEBUG_INI_PATH} |
@ -0,0 +1,6 @@ |
|||||
|
ARG XDEBUG_INI_PATH=/etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini |
||||
|
|
||||
|
COPY ./xdebug3.ini ${XDEBUG_INI_PATH} |
||||
|
|
||||
|
RUN sed -i "s/^;xdebug.client_host=dockerhost/xdebug.client_host=dockerhost/g" ${XDEBUG_INI_PATH} && \ |
||||
|
sed -i "s/^xdebug.discover_client_host/;xdebug.discover_client_host/g" ${XDEBUG_INI_PATH} |
@ -1,5 +1,3 @@ |
|||||
; NOTE: The actual xdebug.so extention is NOT SET HERE but rather (/usr/local/etc/php/conf.d/docker-php-ext-xdebug.ini) |
|
||||
|
|
||||
;xdebug.remote_host=dockerhost |
;xdebug.remote_host=dockerhost |
||||
xdebug.remote_connect_back=1 |
xdebug.remote_connect_back=1 |
||||
xdebug.remote_port=9000 |
xdebug.remote_port=9000 |
@ -1,4 +1,5 @@ |
|||||
xdebug.mode=off |
xdebug.mode=off |
||||
|
;xdebug.client_host=dockerhost |
||||
xdebug.discover_client_host=1 |
xdebug.discover_client_host=1 |
||||
xdebug.start_with_request=yes |
xdebug.start_with_request=yes |
||||
xdebug.output_dir=/tmp/profiler |
xdebug.output_dir=/tmp/profiler |
@ -1,153 +0,0 @@ |
|||||
#! /bin/bash |
|
||||
|
|
||||
# Colors used for status updates |
|
||||
ESC_SEQ="\x1b[" |
|
||||
COL_RESET=$ESC_SEQ"39;49;00m" |
|
||||
COL_RED=$ESC_SEQ"31;01m" |
|
||||
COL_GREEN=$ESC_SEQ"32;01m" |
|
||||
COL_YELLOW=$ESC_SEQ"33;01m" |
|
||||
COL_BLUE=$ESC_SEQ"34;01m" |
|
||||
COL_MAGENTA=$ESC_SEQ"35;01m" |
|
||||
COL_CYAN=$ESC_SEQ"36;01m" |
|
||||
|
|
||||
# Detect which `ls` flavor is in use |
|
||||
if ls --color > /dev/null 2>&1; then # GNU `ls` |
|
||||
colorflag="--color" |
|
||||
export LS_COLORS='no=00:fi=00:di=01;31:ln=01;36:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arj=01;31:*.taz=01;31:*.lzh=01;31:*.zip=01;31:*.z=01;31:*.Z=01;31:*.gz=01;31:*.bz2=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.jpg=01;35:*.jpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.avi=01;35:*.fli=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.ogg=01;35:*.mp3=01;35:*.wav=01;35:' |
|
||||
else # macOS `ls` |
|
||||
colorflag="-G" |
|
||||
export LSCOLORS='BxBxhxDxfxhxhxhxhxcxcx' |
|
||||
fi |
|
||||
|
|
||||
# List all files colorized in long format |
|
||||
#alias l="ls -lF ${colorflag}" |
|
||||
### MEGA: I want l and la ti return hisdden files |
|
||||
alias l="ls -laF ${colorflag}" |
|
||||
|
|
||||
# List all files colorized in long format, including dot files |
|
||||
alias la="ls -laF ${colorflag}" |
|
||||
|
|
||||
# List only directories |
|
||||
alias lsd="ls -lF ${colorflag} | grep --color=never '^d'" |
|
||||
|
|
||||
# Always use color output for `ls` |
|
||||
alias ls="command ls ${colorflag}" |
|
||||
|
|
||||
# Commonly Used Aliases |
|
||||
alias ..="cd .." |
|
||||
alias ...="cd ../.." |
|
||||
alias ....="cd ../../.." |
|
||||
alias .....="cd ../../../.." |
|
||||
alias ~="cd ~" # `cd` is probably faster to type though |
|
||||
alias -- -="cd -" |
|
||||
alias home="cd ~" |
|
||||
|
|
||||
alias h="history" |
|
||||
alias j="jobs" |
|
||||
alias e='exit' |
|
||||
alias c="clear" |
|
||||
alias cla="clear && ls -la" |
|
||||
alias cll="clear && ls -l" |
|
||||
alias cls="clear && ls" |
|
||||
alias code="cd /var/www" |
|
||||
alias ea="vi ~/aliases.sh" |
|
||||
|
|
||||
# Always enable colored `grep` output |
|
||||
# Note: `GREP_OPTIONS="--color=auto"` is deprecated, hence the alias usage. |
|
||||
alias grep='grep --color=auto' |
|
||||
alias fgrep='fgrep --color=auto' |
|
||||
alias egrep='egrep --color=auto' |
|
||||
|
|
||||
alias art="php artisan" |
|
||||
alias artisan="php artisan" |
|
||||
alias cdump="composer dump-autoload -o" |
|
||||
alias composer:dump="composer dump-autoload -o" |
|
||||
alias db:reset="php artisan migrate:reset && php artisan migrate --seed" |
|
||||
alias dusk="php artisan dusk" |
|
||||
alias fresh="php artisan migrate:fresh" |
|
||||
alias migrate="php artisan migrate" |
|
||||
alias refresh="php artisan migrate:refresh" |
|
||||
alias rollback="php artisan migrate:rollback" |
|
||||
alias seed="php artisan db:seed" |
|
||||
alias serve="php artisan serve --quiet &" |
|
||||
|
|
||||
alias phpunit="./vendor/bin/phpunit" |
|
||||
alias pu="phpunit" |
|
||||
alias puf="phpunit --filter" |
|
||||
alias pud='phpunit --debug' |
|
||||
|
|
||||
alias cc='codecept' |
|
||||
alias ccb='codecept build' |
|
||||
alias ccr='codecept run' |
|
||||
alias ccu='codecept run unit' |
|
||||
alias ccf='codecept run functional' |
|
||||
|
|
||||
alias g="gulp" |
|
||||
alias npm-global="npm list -g --depth 0" |
|
||||
alias ra="reload" |
|
||||
alias reload="source ~/.aliases && echo \"$COL_GREEN ==> Aliases Reloaded... $COL_RESET \n \"" |
|
||||
alias run="npm run" |
|
||||
alias tree="xtree" |
|
||||
|
|
||||
# Xvfb |
|
||||
alias xvfb="Xvfb -ac :0 -screen 0 1024x768x16 &" |
|
||||
|
|
||||
# requires installation of 'https://www.npmjs.com/package/npms-cli' |
|
||||
alias npms="npms search" |
|
||||
# requires installation of 'https://www.npmjs.com/package/package-menu-cli' |
|
||||
alias pm="package-menu" |
|
||||
# requires installation of 'https://www.npmjs.com/package/pkg-version-cli' |
|
||||
alias pv="package-version" |
|
||||
# requires installation of 'https://github.com/sindresorhus/latest-version-cli' |
|
||||
alias lv="latest-version" |
|
||||
|
|
||||
# git aliases |
|
||||
alias gaa="git add ." |
|
||||
alias gd="git --no-pager diff" |
|
||||
alias git-revert="git reset --hard && git clean -df" |
|
||||
alias gs="git status" |
|
||||
alias whoops="git reset --hard && git clean -df" |
|
||||
alias glog="git log --oneline --decorate --graph" |
|
||||
alias gloga="git log --oneline --decorate --graph --all" |
|
||||
alias gsh="git show" |
|
||||
alias grb="git rebase -i" |
|
||||
alias gbr="git branch" |
|
||||
alias gc="git commit" |
|
||||
alias gck="git checkout" |
|
||||
alias gull="git pull --rebase" |
|
||||
alias gush="git push" |
|
||||
|
|
||||
# Create a new directory and enter it |
|
||||
function mkd() { |
|
||||
mkdir -p "$@" && cd "$@" |
|
||||
} |
|
||||
|
|
||||
function md() { |
|
||||
mkdir -p "$@" && cd "$@" |
|
||||
} |
|
||||
|
|
||||
function xtree { |
|
||||
find ${1:-.} -print | sed -e 's;[^/]*/;|____;g;s;____|; |;g' |
|
||||
} |
|
||||
|
|
||||
# `tre` is a shorthand for `tree` with hidden files and color enabled, ignoring |
|
||||
# the `.git` directory, listing directories first. The output gets piped into |
|
||||
# `less` with options to preserve color and line numbers, unless the output is |
|
||||
# small enough for one screen. |
|
||||
function tre() { |
|
||||
tree -aC -I '.git|node_modules|bower_components' --dirsfirst "$@" | less -FRNX; |
|
||||
} |
|
||||
|
|
||||
# Determine size of a file or total size of a directory |
|
||||
function fs() { |
|
||||
if du -b /dev/null > /dev/null 2>&1; then |
|
||||
local arg=-sbh; |
|
||||
else |
|
||||
local arg=-sh; |
|
||||
fi |
|
||||
if [[ -n "$@" ]]; then |
|
||||
du $arg -- "$@"; |
|
||||
else |
|
||||
du $arg .[^.]* ./*; |
|
||||
fi; |
|
||||
} |
|
@ -1,13 +0,0 @@ |
|||||
########################################################################### |
|
||||
# Composer: |
|
||||
########################################################################### |
|
||||
|
|
||||
USER laradock |
|
||||
|
|
||||
# Create composer dir for store composer2_auth secret |
|
||||
RUN mkdir -p /home/laradock/.config/composer |
|
||||
|
|
||||
USER root |
|
||||
|
|
||||
# Symlink to composer auth secret |
|
||||
RUN ln -s /run/secrets/composer_auth /home/laradock/.config/composer/auth.json |
|
@ -1,3 +0,0 @@ |
|||||
set-option -g status-interval 1 |
|
||||
set-option -g automatic-rename on |
|
||||
set-option -g automatic-rename-format "#{?#{==:#{pane_current_command},bash},#{b:pane_current_path},#{pane_current_command}}" |
|
@ -1,298 +0,0 @@ |
|||||
# Set Environment Variables |
|
||||
ENV DEBIAN_FRONTEND noninteractive |
|
||||
|
|
||||
# Start as root |
|
||||
USER root |
|
||||
|
|
||||
########################################################################### |
|
||||
# Laradock non-root user: |
|
||||
########################################################################### |
|
||||
|
|
||||
# Add a non-root user to prevent files being created with root permissions on host machine. |
|
||||
ARG PUID=1000 |
|
||||
ENV PUID ${PUID} |
|
||||
ARG PGID=1000 |
|
||||
ENV PGID ${PGID} |
|
||||
|
|
||||
# always run apt update when start and after add new source list, then clean up at end. |
|
||||
RUN set -xe; \ |
|
||||
apt-get update -yqq && \ |
|
||||
pecl channel-update pecl.php.net && \ |
|
||||
groupadd -g ${PGID} laradock && \ |
|
||||
useradd -u ${PUID} -g laradock -m laradock -G docker_env && \ |
|
||||
usermod -p "*" laradock -s /bin/bash && \ |
|
||||
apt-get install -yqq \ |
|
||||
apt-utils \ |
|
||||
# |
|
||||
#-------------------------------------------------------------------------- |
|
||||
# Mandatory Software's Installation |
|
||||
#-------------------------------------------------------------------------- |
|
||||
# |
|
||||
# Mandatory Software's such as ("php-cli", "git", "vim", ....) are |
|
||||
# installed on the base image 'laradock/workspace' image. If you want |
|
||||
# to add more Software's or remove existing one, you need to edit the |
|
||||
# base image (https://github.com/Laradock/workspace). |
|
||||
# |
|
||||
# next lines are here becase there is no auto build on dockerhub see https://github.com/laradock/laradock/pull/1903#issuecomment-463142846 |
|
||||
libzip-dev zip unzip \ |
|
||||
# Install the zip extension |
|
||||
php${PHP_VERSION}-zip \ |
|
||||
# nasm |
|
||||
nasm && \ |
|
||||
php -m | grep -q 'zip' |
|
||||
|
|
||||
# |
|
||||
#-------------------------------------------------------------------------- |
|
||||
# Optional Software's Installation |
|
||||
#-------------------------------------------------------------------------- |
|
||||
# |
|
||||
# Optional Software's will only be installed if you set them to `true` |
|
||||
# in the `docker-compose.yml` before the build. |
|
||||
# Example: |
|
||||
# - WORKSPACE_INSTALL_NODE=false |
|
||||
# - ... |
|
||||
# |
|
||||
|
|
||||
########################################################################### |
|
||||
# Set Timezone |
|
||||
########################################################################### |
|
||||
|
|
||||
ARG TZ=Europe/Moscow |
|
||||
ENV TZ ${TZ} |
|
||||
|
|
||||
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone |
|
||||
|
|
||||
########################################################################### |
|
||||
# Root Aliases |
|
||||
########################################################################### |
|
||||
|
|
||||
USER root |
|
||||
|
|
||||
COPY ./aliases.sh /root/aliases.sh |
|
||||
|
|
||||
RUN sed -i 's/\r//' /root/aliases.sh && \ |
|
||||
echo "" >> ~/.bashrc && \ |
|
||||
echo "# Load Custom Aliases" >> ~/.bashrc && \ |
|
||||
echo "source ~/aliases.sh" >> ~/.bashrc && \ |
|
||||
echo "" >> ~/.bashrc |
|
||||
|
|
||||
########################################################################### |
|
||||
# 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 |
|
||||
|
|
||||
########################################################################### |
|
||||
# MySQL Client: |
|
||||
########################################################################### |
|
||||
|
|
||||
USER root |
|
||||
|
|
||||
ARG INSTALL_MYSQL_CLIENT=false |
|
||||
|
|
||||
RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \ |
|
||||
apt-get update -yqq && \ |
|
||||
apt-get -y install mysql-client \ |
|
||||
;fi |
|
||||
|
|
||||
########################################################################### |
|
||||
# fswatch |
|
||||
########################################################################### |
|
||||
|
|
||||
USER root |
|
||||
|
|
||||
ARG INSTALL_FSWATCH=false |
|
||||
|
|
||||
RUN if [ ${INSTALL_FSWATCH} = true ]; then \ |
|
||||
apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 47FE03C1 \ |
|
||||
&& add-apt-repository -y ppa:hadret/fswatch \ |
|
||||
|| apt-get update -yqq \ |
|
||||
&& apt-get -y install fswatch \ |
|
||||
;fi |
|
||||
|
|
||||
########################################################################### |
|
||||
# ping: |
|
||||
########################################################################### |
|
||||
|
|
||||
USER root |
|
||||
|
|
||||
ARG INSTALL_PING=false |
|
||||
|
|
||||
RUN if [ ${INSTALL_PING} = true ]; then \ |
|
||||
apt-get update -yqq && \ |
|
||||
apt-get -y install inetutils-ping \ |
|
||||
;fi |
|
||||
|
|
||||
########################################################################### |
|
||||
# Install S3 minio client: |
|
||||
########################################################################### |
|
||||
|
|
||||
USER root |
|
||||
|
|
||||
ARG INSTALL_S3_MINIO_CLIENT=false |
|
||||
|
|
||||
RUN if [ ${INSTALL_S3_MINIO_CLIENT} = true ]; then \ |
|
||||
curl https://dl.min.io/client/mc/release/linux-amd64/mc > /usr/local/sbin/mc \ |
|
||||
&& chmod +x /usr/local/sbin/mc \ |
|
||||
; fi |
|
||||
|
|
||||
########################################################################### |
|
||||
# xDebug: |
|
||||
########################################################################### |
|
||||
|
|
||||
RUN if [ $(php -r "echo PHP_MAJOR_VERSION;") = "5" ]; then \ |
|
||||
pecl install xdebug-2.5.5; \ |
|
||||
elif [ $(php -r "echo PHP_MAJOR_VERSION;") = "8" ]; then \ |
|
||||
if [ $(php -r "echo PHP_MINOR_VERSION;") = "1" ]; then \ |
|
||||
pecl install xdebug-3.1.6; \ |
|
||||
elif [ $(php -r "echo PHP_MINOR_VERSION;") = "2" ]; then \ |
|
||||
pecl install xdebug-3.3.1; \ |
|
||||
else \ |
|
||||
pecl install xdebug; \ |
|
||||
fi \ |
|
||||
else \ |
|
||||
pecl install xdebug-2.9.8; \ |
|
||||
fi && \ |
|
||||
echo ';zend_extension=xdebug.so' > /etc/php/${PHP_VERSION}/cli/conf.d/20-xdebug.ini && \ |
|
||||
echo "alias phpunit='php -dzend_extension=xdebug.so /var/www/vendor/bin/phpunit'" >> ~/.bashrc |
|
||||
|
|
||||
########################################################################### |
|
||||
# BZ2: |
|
||||
########################################################################### |
|
||||
|
|
||||
ARG INSTALL_BZ2=false |
|
||||
|
|
||||
RUN if [ ${INSTALL_BZ2} = true ]; then \ |
|
||||
apt-get install -y php${PHP_VERSION}-bz2 \ |
|
||||
;fi |
|
||||
|
|
||||
########################################################################### |
|
||||
# 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 |
|
||||
|
|
||||
########################################################################### |
|
||||
# Check PHP version: |
|
||||
########################################################################### |
|
||||
|
|
||||
RUN set -xe; php -v | head -n 1 | grep -q "PHP ${PHP_VERSION}." |
|
||||
|
|
||||
########################################################################### |
|
||||
# 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 |
|
||||
|
|
||||
########################################################################### |
|
||||
# Node / NVM: |
|
||||
########################################################################### |
|
||||
|
|
||||
USER laradock |
|
||||
|
|
||||
ENV NVM_DIR /home/laradock/.nvm |
|
||||
|
|
||||
RUN mkdir -p $NVM_DIR && \ |
|
||||
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash \ |
|
||||
&& . $NVM_DIR/nvm.sh |
|
||||
|
|
||||
# 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 echo "" >> ~/.bashrc && \ |
|
||||
echo 'export NVM_DIR="$HOME/.nvm"' >> ~/.bashrc && \ |
|
||||
echo '[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" # This loads nvm' >> ~/.bashrc |
|
||||
|
|
||||
# Add NVM binaries to root's .bashrc |
|
||||
USER root |
|
||||
|
|
||||
RUN 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 |
|
||||
|
|
||||
########################################################################### |
|
||||
# Tmux |
|
||||
########################################################################### |
|
||||
|
|
||||
USER root |
|
||||
|
|
||||
RUN apt-get update -yqq && apt-get install -y tmux |
|
||||
|
|
||||
COPY ./tmux.conf /etc/tmux.conf |
|
||||
|
|
||||
########################################################################### |
|
||||
# Remove DST_Root_CA3 |
|
||||
########################################################################### |
|
||||
|
|
||||
USER root |
|
||||
|
|
||||
RUN sed -i 's/^mozilla\/DST_Root_CA_X3\.crt/!mozilla\/DST_Root_CA_X3.crt/g' /etc/ca-certificates.conf && update-ca-certificates |
|
||||
|
|
||||
########################################################################### |
|
||||
# Artisan bash autocompletion from symphony |
|
||||
# @see https://wintercms.com/docs/v1.2/docs/console/introduction#autocompletion--suggested-input-values |
|
||||
########################################################################### |
|
||||
|
|
||||
RUN apt install bash-completion |
|
||||
COPY /completion.sh /etc/bash_completion.d/artisan |
|
||||
|
|
||||
########################################################################### |
|
||||
# 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" /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 |
|
||||
|
|
||||
ARG PHP_OPT_POST_MAX_SIZE=48M |
|
||||
RUN sed -i "s/^post_max_size = .*/post_max_size = $PHP_OPT_UPLOAD_MAX_FILESIZE/g" /etc/php/${PHP_VERSION}/cli/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" /etc/php/${PHP_VERSION}/cli/php.ini |
|
||||
|
|
||||
# |
|
||||
#-------------------------------------------------------------------------- |
|
||||
# Final Touch |
|
||||
#-------------------------------------------------------------------------- |
|
||||
# |
|
||||
|
|
||||
USER root |
|
||||
|
|
||||
# Clean up |
|
||||
RUN apt-get clean && \ |
|
||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \ |
|
||||
rm /var/log/lastlog /var/log/faillog |
|
||||
|
|
||||
# Set default work directory |
|
||||
WORKDIR /var/www |
|
@ -1,8 +0,0 @@ |
|||||
########################################################################### |
|
||||
# xDebug: |
|
||||
########################################################################### |
|
||||
|
|
||||
USER root |
|
||||
|
|
||||
# Copy xdebug configuration for remote debugging |
|
||||
COPY ./xdebug2.ini /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini |
|
@ -1,23 +0,0 @@ |
|||||
; NOTE: The actual xdebug.so extension is NOT SET HERE but rather (/etc/php/7.4/conf.d/20-xdebug.ini) |
|
||||
|
|
||||
xdebug.remote_host=dockerhost |
|
||||
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=/tmp |
|
||||
|
|
||||
xdebug.remote_handler=dbgp |
|
||||
xdebug.remote_mode=req |
|
||||
|
|
||||
xdebug.var_display_max_children=-1 |
|
||||
xdebug.var_display_max_data=-1 |
|
||||
xdebug.var_display_max_depth=-1 |
|
||||
|
|
||||
xdebug.trace_enable_trigger=1 |
|
||||
xdebug.trace_output_dir=/tmp |
|
||||
xdebug.trace_output_name="trace.%t" |
|
@ -1,8 +0,0 @@ |
|||||
########################################################################### |
|
||||
# xDebug: |
|
||||
########################################################################### |
|
||||
|
|
||||
USER root |
|
||||
|
|
||||
# Copy xdebug configuration for remote debugging |
|
||||
COPY ./xdebug3.ini /etc/php/${PHP_VERSION}/cli/conf.d/xdebug.ini |
|
@ -1,3 +0,0 @@ |
|||||
xdebug.mode=debug |
|
||||
xdebug.client_host=dockerhost |
|
||||
xdebug.start_with_request=yes |
|
@ -0,0 +1,29 @@ |
|||||
|
#!/bin/bash |
||||
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" |
||||
|
|
||||
|
cd "$SCRIPT_DIR/.." |
||||
|
|
||||
|
PHP_VERSIONS=(74 81 82 83) |
||||
|
|
||||
|
set -e |
||||
|
|
||||
|
ONLY_PUSH=$2 |
||||
|
|
||||
|
if [ -z "${ONLY_PUSH}" ]; then |
||||
|
for PHP_VERSION in "${PHP_VERSIONS[@]}"; do |
||||
|
docker-compose build "php${PHP_VERSION}" && \ |
||||
|
docker tag "src-php${PHP_VERSION}" "dimti/php:${PHP_VERSION}" |
||||
|
|
||||
|
docker-compose build "workspace${PHP_VERSION}" && \ |
||||
|
docker tag "src-workspace${PHP_VERSION}" "dimti/workspace:${PHP_VERSION}" |
||||
|
done |
||||
|
fi |
||||
|
|
||||
|
WITH_PUSH=$1 |
||||
|
|
||||
|
if [ -n "${WITH_PUSH}" ]; then |
||||
|
for PHP_VERSION in "${PHP_VERSIONS[@]}"; do |
||||
|
docker push "dimti/php:${PHP_VERSION}" |
||||
|
docker push "dimti/workspace:${PHP_VERSION}" |
||||
|
done |
||||
|
fi |
Write
Preview
Loading…
Cancel
Save
Reference in new issue