diff --git a/DOCUMENTATION/content/documentation/index.md b/DOCUMENTATION/content/documentation/index.md
index 47796d46..f5232592 100644
--- a/DOCUMENTATION/content/documentation/index.md
+++ b/DOCUMENTATION/content/documentation/index.md
@@ -1056,8 +1056,21 @@ _Note: You can customize the port on which beanstalkd console is listening by ch
+
+
+## Use Confluence
+1 - Run the Confluence Container (`confluence`) with the `docker-compose up` command. Example:
+```bash
+docker-compose up -d confluence
+```
+
+2 - Open your browser and visit the localhost on port **8090**: `http://localhost:8090`
+
+**Note:** You can you trial version and then you have to buy a licence to use it.
+
+You can set custom confluence version in `CONFLUENCE_VERSION`. [Find more info in section 'Versioning'](https://hub.docker.com/r/atlassian/confluence-server/)
diff --git a/docker-compose.yml b/docker-compose.yml
index bd3d4ae6..1a729e87 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -41,6 +41,8 @@ volumes:
driver: ${VOLUMES_DRIVER}
mosquitto:
driver: ${VOLUMES_DRIVER}
+ confluence:
+ driver: ${VOLUMES_DRIVER}
sonarqube:
driver: ${VOLUMES_DRIVER}
@@ -436,6 +438,10 @@ services:
- SONARQUBE_POSTGRES_DB=${SONARQUBE_POSTGRES_DB}
- SONARQUBE_POSTGRES_USER=${SONARQUBE_POSTGRES_USER}
- 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:
- backend
@@ -1481,3 +1487,17 @@ services:
networks:
- backend
- 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
\ No newline at end of file
diff --git a/env-example b/env-example
index b1c0e73d..6bc5a3f3 100644
--- a/env-example
+++ b/env-example
@@ -375,6 +375,14 @@ JENKINS_HOST_HTTP_PORT=8090
JENKINS_HOST_SLAVE_AGENT_PORT=50000
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_PORT=3000
diff --git a/postgres/docker-entrypoint-initdb.d/.gitignore b/postgres/docker-entrypoint-initdb.d/.gitignore
index 0721338b..a56b450c 100644
--- a/postgres/docker-entrypoint-initdb.d/.gitignore
+++ b/postgres/docker-entrypoint-initdb.d/.gitignore
@@ -2,3 +2,4 @@
!init_gitlab_db.sh
!init_jupyterhub_db.sh
!init_sonarqube_db.sh
+!init_confluence_db.sh
\ No newline at end of file
diff --git a/postgres/docker-entrypoint-initdb.d/init_confluence_db.sh b/postgres/docker-entrypoint-initdb.d/init_confluence_db.sh
new file mode 100644
index 00000000..ce5e9f72
--- /dev/null
+++ b/postgres/docker-entrypoint-initdb.d/init_confluence_db.sh
@@ -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
\ No newline at end of file