Skip to content

Handy docker compose file that sets up a nginx_ssl_keycloak_mysql_redis-docker

Notifications You must be signed in to change notification settings

bjornol/nginx_ssl_keycloak_mysql_redis-docker

Repository files navigation

Nginx_ssl_keycloak_mysql_redis-docker example

Handy docker compose example file that sets up a nginx_ssl_keycloak_mysql_redis as a service ready to use. This compose file is based on serveral other repos and online articles.

Pre-Requirements

Knowledge about all elements in the compose file before use.

Nginx and Let’s Encrypt is taken from this repo. You can find more information here https://github.com/wmnnd/nginx-certbot.

The init-letsencrypt.sh fetched from https://github.com/wmnnd/nginx-certbot has been slightly modefied in this example. In this example you can add domains from comand line, like this:

  • ./init-letsencrypt.sh [staging | production] <domain1 domain2 ...>

Note: The mariadb is build from compose file to use timezone Europe/Oslo. Remove if not needed.

Handy styff

This docker compose file sets up:

Run with ssl sertificates

# Run the docker compose
docker-compose up -d --build

# Init you sertificates
# Depending on you user rights it could be that you have to give the user access to run the shell file.
# Also use staging when testing or you will have to wait for a while between each run.
# Example: chmod +x username:usergroup ./init-letsencrypt.sh
./init-letsencrypt.sh [staging | production] <domain1 domain2 ...>

Run without ssl sertificates ( local testing )

# Run the docker compose
docker-compose -f docker-compose-without-ssl.yml up -d --build

Test the stuff

Examples below will help you test that stuff without ssl sertificates ( local testing ) is running correctly.

Nginx test

# go to your browser:
# expected result: web site opens with "Welcome to nginx!"
http://127.0.0.1:81

Keycloak test

# go to your browser:
# expected result: web site opens
http://127.0.0.1:8180

Now, log in as admin and change the default theme for the one in this example:

Monetdb test

# In command line:
# expected result:
# +--------------------+
# | Database           |
# +--------------------+
# | information_schema |
# | keycloak           |
# +--------------------+
docker exec -it mariadb mysql -ukeycloak -pkeycloak -e "SHOW DATABASES;"

Redis test

# In command line:
# expected result: < PONG
docker exec -it redis redis-cli PING

About

Handy docker compose file that sets up a nginx_ssl_keycloak_mysql_redis-docker

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published