Dedicated example for Traefik

This commit is contained in:
CrazyMax 2019-11-17 07:25:30 +01:00
parent 171e0c32f1
commit fd6895097c
No known key found for this signature in database
GPG Key ID: 3248E46B6BB8C7F7
7 changed files with 98 additions and 59 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
## 21137-RC2 (2019/11/17)
* Allow to set custom `PUID`/`PGID`
## 21137-RC1 (2019/10/24) ## 21137-RC1 (2019/10/24)
* JetBrains License Server 21137 * JetBrains License Server 21137

View File

@ -23,7 +23,7 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other
* Multi-platform image * Multi-platform image
* License server completely customizable via environment variables * License server completely customizable via environment variables
* Registration data and configuration in a single directory * Registration data and configuration in a single directory
* [Traefik](https://github.com/containous/traefik-library-image) as reverse proxy and creation/renewal of Let's Encrypt certificates * [Traefik](https://github.com/containous/traefik-library-image) as reverse proxy and creation/renewal of Let's Encrypt certificates (see [this template](examples/traefik))
## Docker ## Docker
@ -76,8 +76,6 @@ Image: crazymax/jetbrains-license-server:latest
Docker compose is the recommended way to run this image. Copy the content of folder [examples/compose](examples/compose) in `/var/jls/` on your host for example. Edit the compose and env files with your preferences and run the following commands: Docker compose is the recommended way to run this image. Copy the content of folder [examples/compose](examples/compose) in `/var/jls/` on your host for example. Edit the compose and env files with your preferences and run the following commands:
```bash ```bash
touch acme.json
chmod 600 acme.json
docker-compose up -d docker-compose up -d
docker-compose logs -f docker-compose logs -f
``` ```
@ -89,7 +87,7 @@ You can also use the following minimal command:
```bash ```bash
$ docker run -d -p 8000:8000 --name jetbrains_license_server \ $ docker run -d -p 8000:8000 --name jetbrains_license_server \
-e TZ="Europe/Paris" \ -e TZ="Europe/Paris" \
-e JLS_VIRTUAL_HOSTS=jetbrains-license-server.example.com \ -e JLS_VIRTUAL_HOSTS=jls.example.com \
-v $(pwd)/data:/data \ -v $(pwd)/data:/data \
crazymax/jetbrains-license-server:latest crazymax/jetbrains-license-server:latest
``` ```

View File

@ -1,63 +1,18 @@
version: "3.2" version: "3.2"
services: services:
traefik: jls:
image: traefik:1.7-alpine
container_name: traefik
command:
- "--logLevel=INFO"
- "--defaultentrypoints=http,https"
- "--entryPoints=Name:http Address::80 Redirect.EntryPoint:https"
- "--entryPoints=Name:https Address::443 TLS"
- "--docker"
- "--docker.exposedbydefault=false"
- "--docker.domain=example.com"
- "--acme=false"
- "--acme.acmelogging=true"
- "--acme.email=webmaster@example.com"
- "--acme.storage=acme.json"
- "--acme.entryPoint=https"
- "--acme.onhostrule=true"
- "--acme.httpchallenge=true"
- "--acme.httpchallenge.entrypoint=http"
ports:
- target: 80
published: 80
protocol: tcp
- target: 443
published: 443
protocol: tcp
volumes:
- "./acme.json:/acme.json"
- "/var/run/docker.sock:/var/run/docker.sock"
restart: always
app:
image: crazymax/jetbrains-license-server:latest image: crazymax/jetbrains-license-server:latest
container_name: jetbrains_license_server container_name: jls
depends_on: ports:
- traefik - target: 8000
published: 8000
protocol: tcp
volumes: volumes:
- "jetbrains-license-server:/data" - "jls:/data"
labels: env_file:
- "traefik.enable=true" - "./jls.env"
- "traefik.backend=jetbrains-license-server"
- "traefik.port=8000"
- "traefik.frontend.rule=Host:jetbrains-license-server.example.com,an-other-host.example.com"
environment:
- "TZ=Europe/Paris"
- "JLS_VIRTUAL_HOSTS=jetbrains-license-server.example.com,an-other-host.example.com"
- "JLS_CONTEXT=/"
- "JLS_ACCESS_CONFIG=/data/access-config.json"
- "JLS_STATS_RECIPIENTS=webmaster@example.com,an-other-address@example.com"
- "JLS_REPORT_OUT_OF_LICENSE=90"
- "JLS_SMTP_SERVER=smtp.example.com"
- "JLS_SMTP_PORT=25"
- "JLS_SMTP_USERNAME=smtp@example.com"
- "JLS_SMTP_PASSWORD="
- "JLS_STATS_FROM=jetbrains@example.com"
- "JLS_STATS_TOKEN=0123456789ABCDEF"
restart: always restart: always
volumes: volumes:
jetbrains-license-server: jls:

12
examples/compose/jls.env Normal file
View File

@ -0,0 +1,12 @@
TZ=Europe/Paris
JLS_VIRTUAL_HOSTS=127.0.0.1,jls.example.com
JLS_CONTEXT=/
JLS_ACCESS_CONFIG=/data/access-config.json
JLS_STATS_RECIPIENTS=webmaster@example.com,an-other-address@example.com
JLS_REPORT_OUT_OF_LICENSE=90
JLS_SMTP_SERVER=smtp.example.com
JLS_SMTP_PORT=25
JLS_SMTP_USERNAME=smtp@example.com
JLS_SMTP_PASSWORD=
JLS_STATS_FROM=jetbrains@example.com
JLS_STATS_TOKEN=0123456789ABCDEF

View File

@ -0,0 +1,8 @@
## Usage
```bash
touch acme.json
chmod 600 acme.json
docker-compose up -d
docker-compose logs -f
```

View File

@ -0,0 +1,50 @@
version: "3.2"
services:
traefik:
image: traefik:1.7-alpine
container_name: traefik
command:
- "--logLevel=INFO"
- "--defaultentrypoints=http,https"
- "--entryPoints=Name:http Address::80 Redirect.EntryPoint:https"
- "--entryPoints=Name:https Address::443 TLS"
- "--docker"
- "--docker.exposedbydefault=false"
- "--docker.domain=example.com"
- "--acme=false"
- "--acme.acmelogging=true"
- "--acme.email=webmaster@example.com"
- "--acme.storage=acme.json"
- "--acme.entryPoint=https"
- "--acme.onhostrule=true"
- "--acme.httpchallenge=true"
- "--acme.httpchallenge.entrypoint=http"
ports:
- target: 80
published: 80
protocol: tcp
- target: 443
published: 443
protocol: tcp
volumes:
- "./acme.json:/acme.json"
- "/var/run/docker.sock:/var/run/docker.sock"
restart: always
jls:
image: crazymax/jetbrains-license-server:latest
container_name: jls
volumes:
- "jls:/data"
labels:
- "traefik.enable=true"
- "traefik.backend=jls"
- "traefik.port=8000"
- "traefik.frontend.rule=Host:jls.example.com,an-other-host.example.com"
env_file:
- "./jls.env"
restart: always
volumes:
jls:

12
examples/traefik/jls.env Normal file
View File

@ -0,0 +1,12 @@
TZ=Europe/Paris
JLS_VIRTUAL_HOSTS=jls.example.com,an-other-host.example.com
JLS_CONTEXT=/
JLS_ACCESS_CONFIG=/data/access-config.json
JLS_STATS_RECIPIENTS=webmaster@example.com,an-other-address@example.com
JLS_REPORT_OUT_OF_LICENSE=90
JLS_SMTP_SERVER=smtp.example.com
JLS_SMTP_PORT=25
JLS_SMTP_USERNAME=smtp@example.com
JLS_SMTP_PASSWORD=
JLS_STATS_FROM=jetbrains@example.com
JLS_STATS_TOKEN=0123456789ABCDEF