Confluence config added

This commit is contained in:
Anton Sannikov 2019-05-20 22:36:08 +02:00
parent 23193babf4
commit 8027a98f72
4 changed files with 73 additions and 0 deletions

View File

@ -41,6 +41,8 @@ volumes:
driver: ${VOLUMES_DRIVER} driver: ${VOLUMES_DRIVER}
mosquitto: mosquitto:
driver: ${VOLUMES_DRIVER} driver: ${VOLUMES_DRIVER}
confluence:
driver: ${VOLUMES_DRIVER}
sonarqube: sonarqube:
driver: ${VOLUMES_DRIVER} driver: ${VOLUMES_DRIVER}
@ -414,6 +416,10 @@ services:
- SONARQUBE_POSTGRES_DB=${SONARQUBE_POSTGRES_DB} - SONARQUBE_POSTGRES_DB=${SONARQUBE_POSTGRES_DB}
- SONARQUBE_POSTGRES_USER=${SONARQUBE_POSTGRES_USER} - SONARQUBE_POSTGRES_USER=${SONARQUBE_POSTGRES_USER}
- SONARQUBE_POSTGRES_PASSWORD=${SONARQUBE_POSTGRES_PASSWORD} - SONARQUBE_POSTGRES_PASSWORD=${SONARQUBE_POSTGRES_PASSWORD}
- POSTGRES_CONFLUENCE_INIT=${CONFLUENCE_POSTGRES_INIT}
- POSTGRES_CONFLUENCE_DB=${CONFLUENCE_POSTGRES_DB}
- POSTGRES_CONFLUENCE_USER=${CONFLUENCE_POSTGRES_USER}
- POSTGRES_CONFLUENCE_PASSWORD=${CONFLUENCE_POSTGRES_PASSWORD}
networks: networks:
- backend - backend
@ -1459,3 +1465,17 @@ services:
networks: networks:
- backend - backend
- frontend - frontend
### CONFLUENCE ################################################
confluence:
container_name: Confluence
image: atlassian/confluence-server:${CONFLUENCE_VERSION}
restart: always
ports:
- "${CONFLUENCE_HOST_HTTP_PORT}:8090"
networks:
- frontend
- backend
depends_on:
- postgres
volumes:
- ${DATA_PATH_HOST}/Confluence:/var/atlassian/application-data

View File

@ -366,6 +366,14 @@ JENKINS_HOST_HTTP_PORT=8090
JENKINS_HOST_SLAVE_AGENT_PORT=50000 JENKINS_HOST_SLAVE_AGENT_PORT=50000
JENKINS_HOME=./jenkins/jenkins_home JENKINS_HOME=./jenkins/jenkins_home
### CONFLUENCE ###############################################
CONFLUENCE_POSTGRES_INIT=true
CONFLUENCE_VERSION=6.13-ubuntu-18.04-adoptopenjdk8
CONFLUENCE_POSTGRES_DB=laradock_confluence
CONFLUENCE_POSTGRES_USER=laradock_confluence
CONFLUENCE_POSTGRES_PASSWORD=laradock_confluence
CONFLUENCE_HOST_HTTP_PORT=8090
### GRAFANA ############################################### ### GRAFANA ###############################################
GRAFANA_PORT=3000 GRAFANA_PORT=3000

View File

@ -2,3 +2,4 @@
!init_gitlab_db.sh !init_gitlab_db.sh
!init_jupyterhub_db.sh !init_jupyterhub_db.sh
!init_sonarqube_db.sh !init_sonarqube_db.sh
!init_confluence_db.sh

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 confluence ##############################################
if [ "$POSTGRES_CONFLUENCE_INIT" == 'true' ]; then
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE USER $POSTGRES_CONFLUENCE_USER WITH PASSWORD '$POSTGRES_CONFLUENCE_PASSWORD';
CREATE DATABASE $POSTGRES_CONFLUENCE_DB;
GRANT ALL PRIVILEGES ON DATABASE $POSTGRES_CONFLUENCE_DB TO $POSTGRES_CONFLUENCE_USER;
ALTER ROLE $POSTGRES_CONFLUENCE_USER CREATEROLE SUPERUSER;
EOSQL
echo
fi