<commit_before># OpenAM & DJ Docker Container Setup

## What is this?
- Base for experiments around OpenAM and OpenDJ setup for Cloud deployments.
- Greenfield approach - starting from scratch
- Package testing

## Building OpenAM

> Note: please set this as a local domain to auth.terminus.net - if you don't do this, the setup will fail!

```bash
$ sudo -i
$ echo "127.0.0.1   auth.terminus.net" >> /etc/hosts
$ exit
```

### Setup Script
This script will build the java8 base package und show the package links to download.

```bash
./script/setup.sh
```
Move into the openam directory `cd ./openam` and build the OpenAM.

### Building or Download the Debian Packages

#### Download
- Part of the setup script are the download urls. Place both `*.deb` files into the openam folder.

#### Build yourself
Make sure you build the deb package first using `fpm`.

```bash
# Move into the package dir
$ cd package/build
# Place war file into packages/build/opt/tomcat/webapps/
$ cp ~/Downloads/Openam13.war packages/build/opt/tomcat/webapps/z.war
# Build the deb
$ ./run.sh
```

### Build the Base Image
This might seem an unnecessary step to but it saves some time. The base image is actually a oracle jdk java8 build based on ubuntu. The has been some news lately - can't find the reference atm.

Regardless I would recommend you either build it yourself using the commands below or just download it from my docker hub.

```bash
cd java8/
docker build -t redpanda/java8:lastest .
```

**Build Local Image AM/DJ**
```bash
$ cd openam
$ docker build --no-cache -t redpanda/openam:latest .
```
> NOTE: Make sure the `*.deb` are in this folder

## Starting the container

Run interactive:
```bash
$ docker run -it --rm -v `pwd`/config:/config \
    --hostname 'auth.terminus.net' \<commit_msg>fixed port mapper in run command<commit_after># OpenAM & DJ Docker Container Setup

## What is this?
- Base for experiments around OpenAM and OpenDJ setup for Cloud deployments.
- Greenfield approach - starting from scratch
- Package testing

## Building OpenAM

> Note: please set this as a local domain to auth.terminus.net - if you don't do this, the setup will fail!

```bash
$ sudo -i
$ echo "127.0.0.1   auth.terminus.net" >> /etc/hosts
$ exit
```

### Setup Script
This script will build the java8 base package und show the package links to download.

```bash
./script/setup.sh
```
Move into the openam directory `cd ./openam` and build the OpenAM.

### Building or Download the Debian Packages

#### Download
- Part of the setup script are the download urls. Place both `*.deb` files into the openam folder.

#### Build yourself
Make sure you build the deb package first using `fpm`.

```bash
# Move into the package dir
$ cd package/build
# Place war file into packages/build/opt/tomcat/webapps/
$ cp ~/Downloads/Openam13.war packages/build/opt/tomcat/webapps/z.war
# Build the deb
$ ./run.sh
```

### Build the Base Image
This might seem an unnecessary step to but it saves some time. The base image is actually a oracle jdk java8 build based on ubuntu. The has been some news lately - can't find the reference atm.

Regardless I would recommend you either build it yourself using the commands below or just download it from my docker hub.

```bash
cd java8/
docker build -t redpanda/java8:lastest .
```

**Build Local Image AM/DJ**
```bash
$ cd openam
$ docker build --no-cache -t redpanda/openam:latest .
```
> NOTE: Make sure the `*.deb` are in this folder

## Starting the container

Run interactive:
```bash
$ docker run -it -p 8080:8080 --rm -v `pwd`/config:/config \
    --hostname 'auth.terminus.net' \
{'fraction_non_alphanumeric': 0.10310421286031042, 'fraction_numerical': 0.008869179600886918, 'mean_word_length': 3.66882276843467, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5656673', 'n_tokens_mistral': 1137, 'n_tokens_neox': 1049, 'n_words': 497}