Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: docker installation #3027

Merged
merged 9 commits into from
Nov 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 38 additions & 27 deletions docker-jans-monolith/README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,27 @@
# Overview
---
tags:
- administration
- installation
- quick-start
- docker compose
---

**This image is for testing and development purposes only! Use Janssen [helm charts](../charts) for production setups**
> **Warning**
> This image is for testing and development purposes only. Use Janssen [helm charts](https://github.com/JanssenProject/jans/tree/main/charts/janssen) for production setups.
Docker monolith image packaging for Janssen.This image packs janssen services including, the auth-server, config-api, fido2, and scim.
## Overview

## Versions
Docker monolith image packaging for Janssen. This image packs janssen services including the auth-server, config-api, fido2, and scim.

## Pre-requisites

- [Docker](https://docs.docker.com/install)
- [Docker compose](https://docs.docker.com/compose/install/)

See [Releases](https://github.com/JanssenProject/docker-jans-monolith/releases) for stable versions. This image should never be used in production.
For bleeding-edge/unstable version, use `janssenproject/monolith:1.0.4_dev`.

## Environment Variables

The following environment variables are supported by the container:
Installation depends on the set of environment variables shown below. These environment variables can be set to customize installation as per the need. If not set, the installer uses default values.

| ENV | Description | Default |
|-------------------------|--------------------------------------------------|--------------------------------------------------|
Expand All @@ -32,35 +42,37 @@ The following environment variables are supported by the container:
| `MYSQL_HOST` | MySQL host. | `mysql` which is the docker compose service name |


## Pre-requisites
## How to run

- [Docker](https://docs.docker.com/install). Docker compose should be installed by default with Docker.
Download the compose file

## How to run
```bash

wget https://raw.githubusercontent.com/JanssenProject/jans/main/docker-jans-monolith/jans-mysql-compose.yml
```

This docker compose file runs two containers, the janssen monolith container and mysql container.

```bash
docker compose -f jans-mysql-compose.yml up -d
```

## Clean up
To view the containers running

Remove setup and volumes
```bash

```
docker compose -f jans-mysql-compose.yml down && rm -rf jans-*
docker compose -f jans-mysql-compose.yml ps
```

## Test
## Configure Janssen Server

```bash
docker exec -ti docker-jans-monolith-jans-1 bash
```

Run
```bash
/opt/jans/jans-cli/config-cli.py
#or
/opt/jans/jans-cli/scim-cli.py
docker compose -f jans-mysql-compose.yml exec jans sh #This opens a bash terminal in the running container

/opt/jans/jans-cli/config-cli.py #configure using the config-cli

/opt/jans/jans-cli/scim-cli.py #configure using the scim-cli
```

## Access endpoints externally
Expand All @@ -74,11 +86,10 @@ Add to your `/etc/hosts` file the ip domain record which should be the ip of the

After adding the record you can hit endpoints such as https://demoexample.jans.io/.well-known/openid-configuration

## Quick start
## Clean up

Grab a fresh ubuntu 22.04 lts VM and run:
Remove setup and volumes

```bash
wget https://raw.githubusercontent.com/JanssenProject/jans/main/automation/startjanssenmonolithdemo.sh && chmod u+x startjanssenmonolithdemo.sh && sudo bash startjanssenmonolithdemo.sh demoexample.jans.io MYSQL
```

docker compose -f jans-mysql-compose.yml down
```
95 changes: 95 additions & 0 deletions docs/admin/install/docker-install/compose.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
---
moabu marked this conversation as resolved.
Show resolved Hide resolved
tags:
- administration
- installation
- quick-start
- docker compose
---

!!! Warning
**This image is for testing and development purposes only. Use Janssen [helm charts](https://github.com/JanssenProject/jans/tree/main/charts/janssen) for production setups.**

## Overview

Docker monolith image packaging for Janssen. This image packs janssen services including the auth-server, config-api, fido2, and scim.

## Pre-requisites

- [Docker](https://docs.docker.com/install)
- [Docker compose](https://docs.docker.com/compose/install/)


## Environment Variables

Installation depends on the set of environment variables shown below. These environment variables can be set to customize installation as per the need. If not set, the installer uses default values.

| ENV | Description | Default |
|-------------------------|--------------------------------------------------|--------------------------------------------------|
| `CN_HOSTNAME` | Hostname to install janssen with. | `demoexample.jans.io` |
| `CN_ADMIN_PASS` | Password of the admin user. | `1t5Fin3#security` |
| `CN_ORG_NAME` | Organization name. Used for ssl cert generation. | `Janssen` |
| `CN_EMAIL` | Email. Used for ssl cert generation. | `support@jans.io` |
| `CN_CITY` | City. Used for ssl cert generation. | `Austin` |
| `CN_STATE` | State. Used for ssl cert generation | `TX` |
| `CN_COUNTRY` | Country. Used for ssl cert generation. | `US` |
| `CN_INSTALL_LDAP` | **NOT SUPPORRTED YET** | `false` |
| `CN_INSTALL_CONFIG_API` | Installs the Config API service. | `true` |
| `CN_INSTALL_SCIM` | Installs the SCIM API service. | `true` |
| `CN_INSTALL_FIDO2` | Installs the FIDO2 API service. | `true` |
| `MYSQL_DATABASE` | MySQL jans database. | `jans` |
| `MYSQL_USER` | MySQL database user. | `jans` |
| `MYSQL_PASSWORD` | MySQL database user password. | `1t5Fin3#security` |
| `MYSQL_HOST` | MySQL host. | `mysql` which is the docker compose service name |


## How to run

Download the compose file

```bash

wget https://raw.githubusercontent.com/JanssenProject/jans/main/docker-jans-monolith/jans-mysql-compose.yml
```

This docker compose file runs two containers, the janssen monolith container and mysql container.

```bash
docker compose -f jans-mysql-compose.yml up -d
```

To view the containers running

```bash

docker compose -f jans-mysql-compose.yml ps
```

## Configure Janssen Server

```bash

docker compose -f jans-mysql-compose.yml exec jans sh #This opens a bash terminal in the running container

/opt/jans/jans-cli/config-cli.py #configure using the config-cli

/opt/jans/jans-cli/scim-cli.py #configure using the scim-cli
```

## Access endpoints externally

Add to your `/etc/hosts` file the ip domain record which should be the ip of the instance docker is installed at and the domain used in the env above `CN_HOSTNAME`.

```bash
# For-example
172.22.0.3 demoexample.jans.io
```

After adding the record you can hit endpoints such as https://demoexample.jans.io/.well-known/openid-configuration

## Clean up

Remove setup and volumes

```
docker compose -f jans-mysql-compose.yml down
```
Original file line number Diff line number Diff line change
Expand Up @@ -6,38 +6,37 @@ tags:
- docker
---

# Docker Based Quick Start Installation
!!! Warning
**This image is for testing and development purposes only. Use Janssen [helm charts](https://github.com/JanssenProject/jans/tree/main/charts/janssen) for production setups.**

The quickest way to get a Janssen Server up and running is to install a Docker container-based fully featured Janssen Server.

!!! Note
## Overview

This method of installation is suitable only for testing, development, or feature exploration purposes. Not for production deployments.
The quickest way to get a Janssen Server up and running is to install a Docker container-based fully featured Janssen Server.

## System Requirements

System should meet [minimum VM system requirements](vm-requirements.md)

## Install

Run the command given below to start the installation.

Installation depends on a [set of environment variables](https://github.com/JanssenProject/jans/tree/main/docker-jans-monolith#environment-variables).
These environment variables can be set to customize installation as per the need. If not set, the installer uses default values.

Run this command to start the installation:

```bash
wget https://raw.githubusercontent.com/JanssenProject/jans/main/automation/startjanssenmonolithdemo.sh && chmod u+x startjanssenmonolithdemo.sh && sudo bash startjanssenmonolithdemo.sh demoexample.jans.io MYSQL
```

At the end of the process, following messages will confirm that the Janssen server and related services are up and running in respective Docker containers.
Console messages like below confirms the successful installation:

```
[+] Running 3/3
⠿ Network docker-jans-monolith_cloud_bridge Created 0.0s
⠿ Container docker-jans-monolith-mysql-1 Started 0.6s
⠿ Container docker-jans-monolith-jans-1 Started 0.9s
Waiting for the Janssen server to come up. Depending on the resources it may take 3-5 mins for the services to be up.
Waiting for the Janssen server to come up. Depending on the resources it may take 3-5 mins for the services to be up.
Testing openid-configuration endpoint..
```

Expand Down Expand Up @@ -77,13 +76,13 @@ And then use CLI tools to configure Janssen Server as needed.

## Uninstall / Remove the Janssen Server

This docker based installation uses `docker compose` under the hood to create containers. Hence to uninstalling Janssen server involves invoking `docker compose` with appropriate yml file. Run command below to stop and remove containers.
This docker based installation uses `docker compose` under the hood to create containers. Hence uninstalling Janssen server involves invoking `docker compose` with appropriate yml file. Run command below to stop and remove containers.

```
docker compose -f /tmp/jans/docker-jans-monolith/jans-mysql-compose.yml down && rm -rf jans-*
```

Console messages like below confirms the successful removal.
Console messages like below confirms the successful removal:

```
[+] Running 3/3
Expand Down
7 changes: 4 additions & 3 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -139,16 +139,17 @@ nav:
- 'Passwordless Authentication': 'admin/planning/passwordless-auth.md'
- 'Machine-to-Machine Authentication': 'admin/planning/machine-to-machine.md'
- 'Installation':
- 'admin/install/README.md'
- 'VM Installation':
- 'admin/install/vm-install/README.md'
- 'VM Requirements': 'admin/install/vm-install/vm-requirements.md'
- 'Docker Quick Start': 'admin/install/vm-install/quick-start-install.md'
- 'Ubuntu': 'admin/install/vm-install/ubuntu.md'
- 'RHEL': 'admin/install/vm-install/rhel.md'
- 'Suse': 'admin/install/vm-install/suse.md'
# - 'FIPS DISA STIG': 'admin/install/vm-install/disa-stig.md'
- 'Dynamic Download': 'admin/install/vm-install/dynamic-download.md'
- 'Docker Installation':
- 'Quick Start': 'admin/install/docker-install/quick-start.md'
- 'Docker compose': 'admin/install/docker-install/compose.md'
- 'Helm Deployments':
- 'admin/install/helm-install/README.md'
- 'Local Kubernetes Cluster': 'admin/install/helm-install/local.md'
Expand All @@ -157,7 +158,7 @@ nav:
# - 'Digital Ocean DOK': 'admin/install/helm-install/digitalocean-dok.md'
- 'Microsoft Azure AKS': 'admin/install/helm-install/microsoft-azure.md'
# - 'Red Hat Open Shift': 'admin/install/helm-install/red-hat-open-shift.md'
- 'Using Rancher Marketplace': 'admin/install/helm-install/rancher.md'
- 'Using Rancher Marketplace': 'admin/install/helm-install/rancher.md'
- 'Setup Instructions': 'admin/install/setup.md'
- 'FAQ': 'admin/install/install-faq.md'
- 'Kubernetes Operation Guide':
Expand Down