From 76b71d264d0c360a9061289ba3362d3b1aa96e47 Mon Sep 17 00:00:00 2001
From: sevillaarvin <33614172+sevillaarvin@users.noreply.github.com>
Date: Sat, 18 May 2019 10:53:26 +0800
Subject: [PATCH 1/4] Add gitlab-runner documentation (#2131)
---
DOCUMENTATION/content/documentation/index.md | 61 ++++++++++++++++++++
1 file changed, 61 insertions(+)
diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md
index c93d173..0704aba 100644
--- a/DOCUMENTATION/content/documentation/index.md
+++ b/DOCUMENTATION/content/documentation/index.md
@@ -862,6 +862,67 @@ docker-compose up -d gitlab
+
+
+## Use Gitlab Runner
+
+1 - Retrieve the registration token in your gitlab project (Settings > CI / CD > Runners > Set up a specific Runner manually)
+
+2 - Open the `.env` file and set the following changes:
+```
+# so that gitlab container will pass the correct domain to gitlab-runner container
+GITLAB_DOMAIN_NAME=http://gitlab
+
+GITLAB_RUNNER_REGISTRATION_TOKEN=
+
+# so that gitlab-runner container will send POST request for registration to correct domain
+GITLAB_CI_SERVER_URL=http://gitlab
+```
+
+3 - Open the `docker-compose.yml` file and add the following changes:
+```yml
+ gitlab-runner:
+ environment: # these values will be used during `gitlab-runner register`
+ - RUNNER_EXECUTOR=docker # change from shell (default)
+ - DOCKER_IMAGE=alpine
+ - DOCKER_NETWORK_MODE=laradock_backend
+ networks:
+ - backend # connect to network where gitlab service is connected
+```
+
+4 - Run the Gitlab-Runner Container (`gitlab-runner`) with the `docker-compose up` command. Example:
+
+```bash
+docker-compose up -d gitlab-runner
+```
+
+5 - Register the gitlab-runner to the gitlab container
+
+```bash
+docker-compose exec gitlab-runner bash
+gitlab-runner register
+```
+
+6 - Create a `.gitlab-ci.yml` file for your pipeline
+
+```yml
+before_script:
+ - echo Hello!
+
+job1:
+ scripts:
+ - echo job1
+```
+
+7 - Push changes to gitlab
+
+8 - Verify that pipeline is run successful
+
+
+
+
+
+
## Use Adminer
From 7ea44ca25a159deb234c0e41e5670fe50e89c09b Mon Sep 17 00:00:00 2001
From: vlauciani
Date: Sat, 18 May 2019 04:54:45 +0200
Subject: [PATCH 2/4] Set 'logrotate' for 'nginx' logs (#2111)
* Update Dockerfile
Install 'logrotate' for nginx log. Issue https://github.com/laradock/laradock/issues/1357
* Create nginx
Create 'logrotate' file for nginx log. Issue https://github.com/laradock/laradock/issues/1357
* Update Dockerfile
Copy 'logrotate' config file. Issue https://github.com/laradock/laradock/issues/1357
* Update nginx
Add 'nodateext' logrotate option to archive with sequence number
* Update startup.sh
Add line to start 'crond' demon
* Update nginx
Update permissions
---
nginx/Dockerfile | 7 +++++++
nginx/logrotate/nginx | 14 ++++++++++++++
nginx/startup.sh | 4 ++++
3 files changed, 25 insertions(+)
create mode 100644 nginx/logrotate/nginx
diff --git a/nginx/Dockerfile b/nginx/Dockerfile
index 12c456d..c98498f 100644
--- a/nginx/Dockerfile
+++ b/nginx/Dockerfile
@@ -14,6 +14,7 @@ RUN if [ ${CHANGE_SOURCE} = true ]; then \
RUN apk update \
&& apk upgrade \
+ && apk --update add logrotate \
&& apk add --no-cache openssl \
&& apk add --no-cache bash \
&& adduser -D -H -u 1000 -s /bin/bash www-data
@@ -21,6 +22,12 @@ RUN apk update \
ARG PHP_UPSTREAM_CONTAINER=php-fpm
ARG PHP_UPSTREAM_PORT=9000
+# Create 'messages' file used from 'logrotate'
+RUN touch /var/log/messages
+
+# Copy 'logrotate' config file
+COPY logrotate/nginx /etc/logrotate.d/
+
# Set upstream conf and remove the default conf
RUN echo "upstream php-upstream { server ${PHP_UPSTREAM_CONTAINER}:${PHP_UPSTREAM_PORT}; }" > /etc/nginx/conf.d/upstream.conf \
&& rm /etc/nginx/conf.d/default.conf
diff --git a/nginx/logrotate/nginx b/nginx/logrotate/nginx
new file mode 100644
index 0000000..8c89a83
--- /dev/null
+++ b/nginx/logrotate/nginx
@@ -0,0 +1,14 @@
+/var/log/nginx/*.log {
+ daily
+ missingok
+ rotate 32
+ compress
+ delaycompress
+ nodateext
+ notifempty
+ create 644 www-data root
+ sharedscripts
+ postrotate
+ [ -f /var/run/nginx.pid ] && kill -USR1 `cat /var/run/nginx.pid`
+ endscript
+}
diff --git a/nginx/startup.sh b/nginx/startup.sh
index 069d141..f8e7b22 100644
--- a/nginx/startup.sh
+++ b/nginx/startup.sh
@@ -6,4 +6,8 @@ if [ ! -f /etc/nginx/ssl/default.crt ]; then
openssl x509 -req -days 365 -in "/etc/nginx/ssl/default.csr" -signkey "/etc/nginx/ssl/default.key" -out "/etc/nginx/ssl/default.crt"
fi
+# Start crond in background
+crond -l 2 -b
+
+# Start nginx in foreground
nginx
From fbdfc419274fd0d2d7644845399782d6c942a166 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E8=94=A1=E6=AD=A3=E6=B5=B7?=
Date: Sat, 18 May 2019 10:57:01 +0800
Subject: [PATCH 3/4] feat: Add PHP_FPM_INSTALL_XHPROF as an option to install
xhprof extension (#2077)
* feat: Add PHP_FPM_INSTALL_XHPROF as an option to install xhprof extension
* fix: INSTALL_XHPROF default value set false
---
.gitignore | 2 ++
env-example | 1 +
php-fpm/Dockerfile | 28 ++++++++++++++++++++++++++++
php-fpm/xhprof.ini | 8 ++++++++
4 files changed, 39 insertions(+)
create mode 100644 php-fpm/xhprof.ini
diff --git a/.gitignore b/.gitignore
index affb5c6..0673206 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,5 @@
/nginx/ssl/*.crt
/nginx/ssl/*.key
/nginx/ssl/*.csr
+
+.DS_Store
\ No newline at end of file
diff --git a/env-example b/env-example
index d7bbc98..b5986c1 100644
--- a/env-example
+++ b/env-example
@@ -153,6 +153,7 @@ PHP_FPM_INSTALL_IMAGE_OPTIMIZERS=true
PHP_FPM_INSTALL_PHPREDIS=true
PHP_FPM_INSTALL_MEMCACHED=false
PHP_FPM_INSTALL_XDEBUG=false
+PHP_FPM_INSTALL_XHPROF=false
PHP_FPM_INSTALL_PHPDBG=false
PHP_FPM_INSTALL_IMAP=false
PHP_FPM_INSTALL_MONGO=false
diff --git a/php-fpm/Dockerfile b/php-fpm/Dockerfile
index 17a9841..9d90ee6 100644
--- a/php-fpm/Dockerfile
+++ b/php-fpm/Dockerfile
@@ -239,6 +239,34 @@ RUN if [ ${INSTALL_MONGO} = true ]; then \
docker-php-ext-enable mongodb \
;fi
+###########################################################################
+# Xhprof:
+###########################################################################
+
+ARG INSTALL_XHPROF=false
+
+RUN if [ ${INSTALL_XHPROF} = true ]; then \
+ # Install the php xhprof extension
+ if [ $(php -r "echo PHP_MAJOR_VERSION;") = 7 ]; then \
+ curl -L -o /tmp/xhprof.tar.gz "https://github.com/tideways/php-xhprof-extension/archive/v4.1.6.tar.gz"; \
+ else \
+ curl -L -o /tmp/xhprof.tar.gz "https://codeload.github.com/phacility/xhprof/tar.gz/master"; \
+ fi \
+ && mkdir -p xhprof \
+ && tar -C xhprof -zxvf /tmp/xhprof.tar.gz --strip 1 \
+ && ( \
+ cd xhprof \
+ && phpize \
+ && ./configure \
+ && make \
+ && make install \
+ ) \
+ && rm -r xhprof \
+ && rm /tmp/xhprof.tar.gz \
+;fi
+
+COPY ./xhprof.ini /usr/local/etc/php/conf.d
+
###########################################################################
# AMQP:
###########################################################################
diff --git a/php-fpm/xhprof.ini b/php-fpm/xhprof.ini
new file mode 100644
index 0000000..1b010b9
--- /dev/null
+++ b/php-fpm/xhprof.ini
@@ -0,0 +1,8 @@
+[xhprof]
+; extension=xhprof.so
+extension=tideways.so
+xhprof.output_dir=/var/www/xhprof
+; no need to autoload, control in the program
+tideways.auto_prepend_library=0
+; set default rate
+tideways.sample_rate=100
\ No newline at end of file
From 23193babf416102ce61001b829c8afdb53fa5d91 Mon Sep 17 00:00:00 2001
From: Alexandr Shevchenko
Date: Sat, 18 May 2019 08:06:30 +0300
Subject: [PATCH 4/4] Workspace: blackfire gpg.key url fixed (#2133)
---
workspace/Dockerfile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/workspace/Dockerfile b/workspace/Dockerfile
index 7dd79bd..d286ece 100644
--- a/workspace/Dockerfile
+++ b/workspace/Dockerfile
@@ -345,7 +345,7 @@ ARG BLACKFIRE_CLIENT_TOKEN
ENV BLACKFIRE_CLIENT_TOKEN ${BLACKFIRE_CLIENT_TOKEN}
RUN if [ ${INSTALL_XDEBUG} = false -a ${INSTALL_BLACKFIRE} = true ]; then \
- curl -L https://packagecloud.io/gpg.key | apt-key add - && \
+ curl -L https://packages.blackfire.io/gpg.key | apt-key add - && \
echo "deb http://packages.blackfire.io/debian any main" | tee /etc/apt/sources.list.d/blackfire.list && \
apt-get update -yqq && \
apt-get install blackfire-agent \