Merge remote-tracking branch 'upstream/master' into xia-master

This commit is contained in:
xiagw 2019-05-10 21:04:41 +08:00
commit 6794418fa6
13 changed files with 185 additions and 83 deletions

View File

@ -1728,6 +1728,31 @@ To install FFMPEG in the Workspace container
3 - Re-build the container `docker-compose build workspace`
4 - If you use the `php-worker` container too, please follow the same steps above especially if you have conversions that have been queued.
**PS** Don't forget to install the binary in the `php-fpm` container too by applying the same steps above to its container, otherwise the you'll get an error when running the `php-ffmpeg` binary.
<br>
<a name="Install-GNU-Parallel"></a>
## Install GNU Parallel
GNU Parallel is a command line tool to run multiple processes in parallel.
(see https://www.gnu.org/software/parallel/parallel_tutorial.html)
To install GNU Parallel in the Workspace container
1 - Open the `.env` file
2 - Search for the `WORKSPACE_INSTALL_GNU_PARALLEL` argument under the Workspace Container and set it to `true`
3 - Re-build the container `docker-compose build workspace`

View File

@ -1,7 +1,3 @@
FROM aerospike:latest
LABEL maintainer="Luciano Jr <luciano@lucianojr.com.br>"
RUN rm /etc/aerospike/aerospike.conf
COPY aerospike.conf /etc/aerospike/aerospike.conf

View File

@ -1,77 +0,0 @@
# Aerospike database configuration file.
# This stanza must come first.
service {
user root
group root
paxos-single-replica-limit 1 # Number of nodes where the replica count is automatically reduced to 1.
pidfile /var/run/aerospike/asd.pid
service-threads 4
transaction-queues 4
transaction-threads-per-queue 4
proto-fd-max 15000
}
logging {
# Log file must be an absolute path.
file /var/log/aerospike/aerospike.log {
context any info
}
# Send log messages to stdout
console {
context any critical
}
}
network {
service {
address any
port 3000
# Uncomment the following to set the `access-address` parameter to the
# IP address of the Docker host. This will the allow the server to correctly
# publish the address which applications and other nodes in the cluster to
# use when addressing this node.
# access-address <IPADDR>
}
heartbeat {
# mesh is used for environments that do not support multicast
mode mesh
port 3002
# use asinfo -v 'tip:host=<ADDR>;port=3002' to inform cluster of
# other mesh nodes
mesh-port 3002
interval 150
timeout 10
}
fabric {
port 3001
}
info {
port 3003
}
}
namespace test {
replication-factor 2
memory-size 1G
default-ttl 5d # 5 days, use 0 to never expire/evict.
# storage-engine memory
# To use file storage backing, comment out the line above and use the
# following lines instead.
storage-engine device {
file /opt/aerospike/data/test.dat
filesize 4G
data-in-memory true # Store data in memory in addition to file.
}
}

View File

@ -41,6 +41,8 @@ volumes:
driver: ${VOLUMES_DRIVER}
mosquitto:
driver: ${VOLUMES_DRIVER}
sonarqube:
driver: ${VOLUMES_DRIVER}
services:
@ -110,6 +112,7 @@ services:
- BLACKFIRE_CLIENT_TOKEN=${BLACKFIRE_CLIENT_TOKEN}
- INSTALL_POWERLINE=${WORKSPACE_INSTALL_POWERLINE}
- INSTALL_FFMPEG=${WORKSPACE_INSTALL_FFMPEG}
- INSTALL_GNU_PARALLEL=${WORKSPACE_INSTALL_GNU_PARALLEL}
volumes:
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG}
extra_hosts:
@ -153,6 +156,7 @@ services:
- INSTALL_MYSQLI=${PHP_FPM_INSTALL_MYSQLI}
- INSTALL_PGSQL=${PHP_FPM_INSTALL_PGSQL}
- INSTALL_PG_CLIENT=${PHP_FPM_INSTALL_PG_CLIENT}
- INSTALL_POSTGIS=${PHP_FPM_INSTALL_POSTGIS}
- INSTALL_INTL=${PHP_FPM_INSTALL_INTL}
- INSTALL_GHOSTSCRIPT=${PHP_FPM_INSTALL_GHOSTSCRIPT}
- INSTALL_LDAP=${PHP_FPM_INSTALL_LDAP}
@ -165,9 +169,11 @@ services:
- INSTALL_IONCUBE=${PHP_FPM_INSTALL_IONCUBE}
- INSTALL_APCU=${PHP_FPM_INSTALL_APCU}
- INSTALL_YAML=${PHP_FPM_INSTALL_YAML}
- INSTALL_RDKAFKA=${PHP_FPM_INSTALL_RDKAFKA}
- INSTALL_ADDITIONAL_LOCALES=${PHP_FPM_INSTALL_ADDITIONAL_LOCALES}
- INSTALL_MYSQL_CLIENT=${PHP_FPM_INSTALL_MYSQL_CLIENT}
- ADDITIONAL_LOCALES=${PHP_FPM_ADDITIONAL_LOCALES}
- INSTALL_FFMPEG=${PHP_FPM_FFMPEG}
volumes:
- ./php-fpm/php${PHP_VERSION}.ini:/usr/local/etc/php/php.ini
- ${APP_CODE_PATH_HOST}:${APP_CODE_PATH_CONTAINER}${APP_CODE_CONTAINER_FLAG}
@ -202,6 +208,7 @@ services:
- INSTALL_AMQP=${PHP_WORKER_INSTALL_AMQP}
- INSTALL_GHOSTSCRIPT=${PHP_WORKER_INSTALL_GHOSTSCRIPT}
- INSTALL_SWOOLE=${PHP_WORKER_INSTALL_SWOOLE}
- INSTALL_FFMPEG=${PHP_WORKER_INSTALL_FFMPEG}
- PUID=${PHP_WORKER_PUID}
- PGID=${PHP_WORKER_PGID}
volumes:
@ -403,6 +410,10 @@ services:
- JUPYTERHUB_POSTGRES_USER=${JUPYTERHUB_POSTGRES_USER}
- JUPYTERHUB_POSTGRES_PASSWORD=${JUPYTERHUB_POSTGRES_PASSWORD}
- JUPYTERHUB_POSTGRES_DB=${JUPYTERHUB_POSTGRES_DB}
- SONARQUBE_POSTGRES_INIT=${SONARQUBE_POSTGRES_INIT}
- SONARQUBE_POSTGRES_DB=${SONARQUBE_POSTGRES_DB}
- SONARQUBE_POSTGRES_USER=${SONARQUBE_POSTGRES_USER}
- SONARQUBE_POSTGRES_PASSWORD=${SONARQUBE_POSTGRES_PASSWORD}
networks:
- backend
@ -493,6 +504,10 @@ services:
- "${AEROSPIKE_FABRIC_PORT}:3001"
- "${AEROSPIKE_HEARTBEAT_PORT}:3002"
- "${AEROSPIKE_INFO_PORT}:3003"
environment:
- STORAGE_GB=${AEROSPIKE_STORAGE_GB}
- MEM_GB=${AEROSPIKE_MEM_GB}
- NAMESPACE=${AEROSPIKE_NAMESPACE}
networks:
- backend
@ -1421,3 +1436,26 @@ services:
- "${MANTICORE_HTTP_PORT}:9308"
networks:
- backend
### SONARQUBE ################################################
sonarqube:
build:
context: ./sonarqube
hostname: "${SONARQUBE_HOSTNAME}"
volumes:
- ${DATA_PATH_HOST}/sonarqube/conf:/opt/sonarqube/conf
- ${DATA_PATH_HOST}/sonarqube/data:/opt/sonarqube/data
- ${DATA_PATH_HOST}/sonarqube/logs:/opt/sonarqube/logs
- ${DATA_PATH_HOST}/sonarqube/extensions:/opt/sonarqube/extensions
- ${DATA_PATH_HOST}/sonarqube/plugins:/opt/sonarqube/lib/bundled-plugins
ports:
- ${SONARQUBE_PORT}:9000
depends_on:
- postgres
environment:
- sonar.jdbc.username=${SONARQUBE_POSTGRES_USER}
- sonar.jdbc.password=${SONARQUBE_POSTGRES_PASSWORD}
- sonar.jdbc.url=jdbc:postgresql://${SONARQUBE_POSTGRES_HOST}:5432/${SONARQUBE_POSTGRES_DB}
networks:
- backend
- frontend

View File

@ -140,6 +140,7 @@ WORKSPACE_CHROME_DRIVER_VERSION=2.42
WORKSPACE_TIMEZONE=UTC
WORKSPACE_SSH_PORT=2222
WORKSPACE_INSTALL_FFMPEG=false
WORKSPACE_INSTALL_GNU_PARALLEL=false
### PHP_FPM ###############################################
@ -169,15 +170,18 @@ PHP_FPM_INSTALL_LDAP=false
PHP_FPM_INSTALL_PHALCON=false
PHP_FPM_INSTALL_SWOOLE=false
PHP_FPM_INSTALL_PG_CLIENT=false
PHP_FPM_INSTALL_POSTGIS=false
PHP_FPM_INSTALL_PCNTL=false
PHP_FPM_INSTALL_CALENDAR=false
PHP_FPM_INSTALL_FAKETIME=false
PHP_FPM_INSTALL_IONCUBE=false
PHP_FPM_INSTALL_RDKAFKA=false
PHP_FPM_FAKETIME=-0
PHP_FPM_INSTALL_APCU=false
PHP_FPM_INSTALL_YAML=false
PHP_FPM_INSTALL_ADDITIONAL_LOCALES=false
PHP_FPM_INSTALL_MYSQL_CLIENT=false
PHP_FPM_FFMPEG=false
PHP_FPM_ADDITIONAL_LOCALES="es_ES.UTF-8 fr_FR.UTF-8"
### PHP_WORKER ############################################
@ -191,6 +195,7 @@ PHP_WORKER_INSTALL_MYSQL_CLIENT=false
PHP_WORKER_INSTALL_AMQP=false
PHP_WORKER_INSTALL_GHOSTSCRIPT=false
PHP_WORKER_INSTALL_SWOOLE=false
PHP_WORKER_INSTALL_FFMPEG=false
PHP_WORKER_PUID=1000
PHP_WORKER_PGID=1000
@ -379,6 +384,9 @@ AEROSPIKE_SERVICE_PORT=3000
AEROSPIKE_FABRIC_PORT=3001
AEROSPIKE_HEARTBEAT_PORT=3002
AEROSPIKE_INFO_PORT=3003
AEROSPIKE_STORAGE_GB=1
AEROSPIKE_MEM_GB=1
AEROSPIKE_NAMESPACE=test
### RETHINKDB #############################################
@ -676,3 +684,19 @@ MANTICORE_HTTP_PORT=9308
PGADMIN_PORT=5050
PGADMIN_DEFAULT_EMAIL=pgadmin4@pgadmin.org
PGADMIN_DEFAULT_PASSWORD=admin
### SONARQUBE ################################################
## docker-compose up -d sonarqube
## (If you encounter a database error)
## docker-compose exec --user=root postgres
## source docker-entrypoint-initdb.d/init_sonarqube_db.sh
## (If you encounter logs error)
## docker-compose run --user=root --rm sonarqube chown sonarqube:sonarqube /opt/sonarqube/logs
SONARQUBE_HOSTNAME=sonar.example.com
SONARQUBE_PORT=9000
SONARQUBE_POSTGRES_INIT=true
SONARQUBE_POSTGRES_HOST=postgres
SONARQUBE_POSTGRES_DB=sonar
SONARQUBE_POSTGRES_USER=sonar
SONARQUBE_POSTGRES_PASSWORD=sonarPass

View File

View File

@ -128,13 +128,17 @@ RUN if [ ${INSTALL_PGSQL} = true ]; then \
###########################################################################
ARG INSTALL_PG_CLIENT=false
ARG INSTALL_POSTGIS=false
RUN if [ ${INSTALL_PG_CLIENT} = true ]; then \
# Create folders if not exists (https://github.com/tianon/docker-brew-debian/issues/65)
mkdir -p /usr/share/man/man1 && \
mkdir -p /usr/share/man/man7 && \
# Install the pgsql client
apt-get install -y postgresql-client \
apt-get install -y postgresql-client && \
if [ ${INSTALL_POSTGIS} = true ]; then \
apt-get install -y postgis; \
fi \
;fi
###########################################################################
@ -598,6 +602,18 @@ RUN if [ ${INSTALL_YAML} = true ]; then \
docker-php-ext-enable yaml \
;fi
###########################################################################
# RDKAFKA:
###########################################################################
ARG INSTALL_RDKAFKA=false
RUN if [ ${INSTALL_RDKAFKA} = true ]; then \
apt-get install -y librdkafka-dev && \
pecl install rdkafka && \
docker-php-ext-enable rdkafka \
;fi
###########################################################################
# Install additional locales:
###########################################################################
@ -627,6 +643,19 @@ RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \
apt-get -y install mysql-client \
;fi
###########################################################################
# FFMPEG:
###########################################################################
USER root
ARG INSTALL_FFMPEG=false
RUN if [ ${INSTALL_FFMPEG} = true ]; then \
apt-get update -yqq && \
apt-get -y install ffmpeg \
;fi
###########################################################################
# Check PHP version:
###########################################################################

View File

@ -69,6 +69,12 @@ RUN if [ ${INSTALL_MYSQL_CLIENT} = true ]; then \
apk --update add mysql-client \
;fi
# Install FFMPEG:
ARG INSTALL_FFMPEG=false
RUN if [ ${INSTALL_FFMPEG} = true ]; then \
apk --update add ffmpeg \
;fi
# Install AMQP:
ARG INSTALL_AMQP=false

View File

@ -1,3 +1,4 @@
*.sh
!init_gitlab_db.sh
!init_jupyterhub_db.sh
!init_sonarqube_db.sh

View File

@ -33,7 +33,7 @@
# EOSQL
#
### default database and user for jupyterhub ##############################################
if [ $JUPYTERHUB_POSTGRES_INIT == 'true' ]; then
if [ "$JUPYTERHUB_POSTGRES_INIT" == 'true' ]; then
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE USER $JUPYTERHUB_POSTGRES_USER WITH PASSWORD '$JUPYTERHUB_POSTGRES_PASSWORD';
CREATE DATABASE $JUPYTERHUB_POSTGRES_DB;

View File

@ -0,0 +1,44 @@
#!/bin/bash
#
# Copy createdb.sh.example to createdb.sh
# then uncomment then set database name and username to create you need databases
#
# example: .env POSTGRES_USER=appuser and need db name is myshop_db
#
# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
# CREATE USER myuser WITH PASSWORD 'mypassword';
# CREATE DATABASE myshop_db;
# GRANT ALL PRIVILEGES ON DATABASE myshop_db TO myuser;
# EOSQL
#
# this sh script will auto run when the postgres container starts and the $DATA_PATH_HOST/postgres not found.
#
#
# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
# CREATE USER db1 WITH PASSWORD 'db1';
# CREATE DATABASE db1;
# GRANT ALL PRIVILEGES ON DATABASE db1 TO db1;
# EOSQL
#
# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
# CREATE USER db2 WITH PASSWORD 'db2';
# CREATE DATABASE db2;
# GRANT ALL PRIVILEGES ON DATABASE db2 TO db2;
# EOSQL
#
# psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
# CREATE USER db3 WITH PASSWORD 'db3';
# CREATE DATABASE db3;
# GRANT ALL PRIVILEGES ON DATABASE db3 TO db3;
# EOSQL
#
### default database and user for gitlab ##############################################
if [ "$SONARQUBE_POSTGRES_INIT" == 'true' ]; then
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE USER $SONARQUBE_POSTGRES_USER WITH PASSWORD '$SONARQUBE_POSTGRES_PASSWORD';
CREATE DATABASE $SONARQUBE_POSTGRES_DB;
GRANT ALL PRIVILEGES ON DATABASE $SONARQUBE_POSTGRES_DB TO $SONARQUBE_POSTGRES_USER;
ALTER ROLE $SONARQUBE_POSTGRES_USER CREATEROLE SUPERUSER;
EOSQL
echo
fi

3
sonarqube/Dockerfile Normal file
View File

@ -0,0 +1,3 @@
FROM sonarqube:latest
LABEL maintainer="xiagw <fxiaxiaoyu@gmail.com>"

View File

@ -1002,6 +1002,19 @@ RUN if [ ${INSTALL_FFMPEG} = true ]; then \
apt-get -y install ffmpeg \
;fi
###########################################################################
# GNU Parallel:
###########################################################################
USER root
ARG INSTALL_GNU_PARALLEL=false
RUN if [ ${INSTALL_GNU_PARALLEL} = true ]; then \
apt-get -y install parallel \
;fi
###########################################################################
# Check PHP version:
###########################################################################