Compare commits

...

33 Commits

Author SHA1 Message Date
148519fb43 add heroku 2020-04-16 13:43:37 +07:00
CrazyMax
568e2d961e
Switch to Open Container Specification labels as label-schema.org ones are deprecated 2020-04-07 19:58:43 +02:00
CrazyMax
b6570cbf4a
Settings 2020-02-12 23:11:03 +01:00
CrazyMax
d128133e79
JetBrains License Server 22218
AdoptOpenJDK JRE 13
2020-02-04 18:36:29 +01:00
CrazyMax
61df733099
Updte bug report tpl 2020-02-04 18:36:03 +01:00
CrazyMax
62de4c614c
Fix timezone 2019-12-07 16:09:30 +01:00
CrazyMax
6f91dbf64c
Proxy type defaults to https
More unset
2019-11-28 18:28:07 +01:00
CrazyMax
737f2bd964
Update README 2019-11-28 17:23:59 +01:00
CrazyMax
3cef833bde
Add env vars to set proxy settings (#21) 2019-11-28 17:12:56 +01:00
CrazyMax
fd6895097c
Dedicated example for Traefik 2019-11-17 07:25:30 +01:00
CrazyMax
171e0c32f1
Allow to set custom PUID/PGID 2019-11-17 07:15:23 +01:00
CrazyMax
fdb28342f3
Update README 2019-11-13 17:10:49 +01:00
CrazyMax
7f5f161300
Update workflows 2019-11-13 17:10:42 +01:00
CrazyMax
bfcb34f6f4
Update README 2019-10-26 20:01:34 +02:00
CrazyMax
89ffc880f9
JetBrains License Server 21137 (#19) 2019-10-24 18:45:50 +02:00
CrazyMax
f6aca1ead3
Update labels workflow 2019-10-24 18:41:57 +02:00
CrazyMax
8f4d76fb7f
Final labels 2019-10-20 05:19:03 +02:00
CrazyMax
cf603f0736
Fix Docker labels 2019-10-20 05:18:58 +02:00
CrazyMax
13cec3d9a9
Add ghaction-github-labeler 2019-10-20 01:19:39 +02:00
CrazyMax
6359aa45f0
Optimize layers 2019-10-10 16:37:50 +02:00
CrazyMax
a8d867a41f
Update CHANGELOG 2019-10-10 16:14:50 +02:00
CrazyMax
2d2c94dbcf
Update README 2019-10-10 16:14:40 +02:00
CrazyMax
5fc3fa53b5
Switch to GitHub Actions
Stop publishing Docker image on Quay
2019-10-10 16:04:08 +02:00
CrazyMax
3471f7d26d
Multi-platform Docker image
Run as non-root user
2019-10-10 15:58:56 +02:00
CrazyMax
3e9d114333
Set timezone through tzdata 2019-10-10 15:26:40 +02:00
CrazyMax
61de4e84a7
Update README 2019-10-10 15:20:39 +02:00
CrazyMax
d0f04e2bed
Update README 2019-08-07 09:51:43 +02:00
CrazyMax
43f331f798
Add healthcheck 2019-08-04 09:26:54 +02:00
CrazyMax
1b7c1ccafa
JetBrains License Server 20308 2019-07-30 14:56:03 +02:00
CrazyMax
744f335ca1
Update README 2019-07-29 06:32:48 +02:00
CrazyMax
ab88f3f93f
Update README 2019-07-25 05:41:12 +02:00
CrazyMax
dd189e58da
Update FUNDING 2019-07-24 13:12:16 +02:00
CrazyMax
af04242028
OpenJDK JRE 12
Alpine Linux 3.10
2019-07-22 20:38:02 +02:00
22 changed files with 572 additions and 286 deletions

View File

@ -3,12 +3,11 @@
/*.iml /*.iml
/.git /.git
/.github
/.res /.res
/examples /examples
/.editorconfig /.editorconfig
/.gitignore /.gitignore
/.travis.yml
/build.sh
/CHANGELOG.md /CHANGELOG.md
/LICENSE /LICENSE
/README.md /README.md

1
.github/CODEOWNERS vendored Normal file
View File

@ -0,0 +1 @@
* @crazy-max

3
.github/FUNDING.yml vendored
View File

@ -1 +1,2 @@
custom: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3BXL8EBDJALHQ github: crazy-max
custom: https://www.paypal.me/crazyws

View File

@ -24,6 +24,7 @@ about: Create a report to help us improve
* Docker version (type `docker --version`) : * Docker version (type `docker --version`) :
* Docker compose version if applicable (type `docker-compose --version`) : * Docker compose version if applicable (type `docker-compose --version`) :
* Platform (Debian 9, Ubuntu 18.04, ...) : * Platform (Debian 9, Ubuntu 18.04, ...) :
* System info (type `uname -a`) :
* Include all necessary configuration files : `docker-compose.yml`, `.env`, ... * Include all necessary configuration files : `docker-compose.yml`, `.env`, ...
### Docker info ### Docker info

69
.github/labels.yml vendored Normal file
View File

@ -0,0 +1,69 @@
## https://github.com/crazy-max/ghaction-github-labeler
- # bot
name: ":robot: bot"
color: "69cde9"
description: ""
- # bug
name: ":bug: bug"
color: "b60205"
description: ""
- # documentation
name: ":memo: documentation"
color: "c5def5"
description: ""
- # duplicate
name: ":busts_in_silhouette: duplicate"
color: "cccccc"
description: ""
- # enhancement
name: ":sparkles: enhancement"
color: "0054ca"
description: ""
- # feature request
name: ":bulb: feature request"
color: "0e8a16"
description: ""
- # feedback
name: ":mega: feedback"
color: "03a9f4"
description: ""
- # future maybe
name: ":rocket: future maybe"
color: "fef2c0"
description: ""
- # good first issue
name: ":hatching_chick: good first issue"
color: "7057ff"
description: ""
- # help wanted
name: ":pray: help wanted"
color: "4caf50"
description: ""
- # hold
name: ":hand: hold"
color: "24292f"
description: ""
- # invalid
name: ":no_entry_sign: invalid"
color: "e6e6e6"
description: ""
- # maybe bug
name: ":interrobang: maybe bug"
color: "ff5722"
description: ""
- # needs more info
name: ":thinking: needs more info"
color: "795548"
description: ""
- # question
name: ":question: question"
color: "3f51b5"
description: ""
- # upstream
name: ":eyes: upstream"
color: "fbca04"
description: ""
- # wontfix
name: ":coffin: wontfix"
color: "ffffff"
description: ""

80
.github/workflows/build.yml vendored Normal file
View File

@ -0,0 +1,80 @@
name: build
on:
push:
branches: 'master'
tags: '*'
paths:
- '.github/workflows/build.yml'
- 'Dockerfile'
- 'entrypoint.sh'
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name: Prepare
id: prepare
run: |
if [[ $GITHUB_REF == refs/tags/* ]]; then
TAG=${GITHUB_REF#refs/tags/}
echo ::set-output name=tag_name::${TAG}
echo ::set-output name=version::${TAG%-*}
else
echo ::set-output name=version::snapshot
fi
echo ::set-output name=build_date::$(date -u +'%Y-%m-%dT%H:%M:%SZ')
echo ::set-output name=docker_platforms::linux/amd64,linux/arm64,linux/ppc64le,linux/s390x
echo ::set-output name=docker_username::crazymax
echo ::set-output name=docker_image::crazymax/jetbrains-license-server
-
# https://github.com/crazy-max/ghaction-docker-buildx
name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
-
# https://github.com/actions/checkout
name: Checkout
uses: actions/checkout@v1
-
name: Docker Buildx (no push)
run: |
docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \
--output "type=image,push=false" \
--build-arg "BUILD_DATE=${{ steps.prepare.outputs.build_date }}" \
--build-arg "VCS_REF=${GITHUB_SHA::8}" \
--build-arg "VERSION=${{ steps.prepare.outputs.version }}" \
--tag "${{ steps.prepare.outputs.docker_image }}:latest" \
--tag "${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}" \
--file Dockerfile .
-
name: Docker Login
if: success() && startsWith(github.ref, 'refs/tags/')
env:
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: |
echo "${DOCKER_PASSWORD}" | docker login --username "${{ steps.prepare.outputs.docker_username }}" --password-stdin
-
name: Docker Buildx (push)
if: success() && startsWith(github.ref, 'refs/tags/')
run: |
docker buildx build --platform ${{ steps.prepare.outputs.docker_platforms }} \
--output "type=image,push=true" \
--build-arg "BUILD_DATE=${{ steps.prepare.outputs.build_date }}" \
--build-arg "VCS_REF=${GITHUB_SHA::8}" \
--build-arg "VERSION=${{ steps.prepare.outputs.version }}" \
--tag "${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}" \
--tag "${{ steps.prepare.outputs.docker_image }}:latest" \
--file Dockerfile .
-
name: Docker Check Manifest
if: always() && startsWith(github.ref, 'refs/tags/')
run: |
docker run --rm mplatform/mquery ${{ steps.prepare.outputs.docker_image }}:${{ steps.prepare.outputs.version }}
-
name: Clear
if: always() && startsWith(github.ref, 'refs/tags/')
run: |
rm -f ${HOME}/.docker/config.json

25
.github/workflows/labels.yml vendored Normal file
View File

@ -0,0 +1,25 @@
name: labels
on:
push:
branches:
- 'master'
paths:
- '.github/labels.yml'
- '.github/workflows/labels.yml'
jobs:
labeler:
runs-on: ubuntu-latest
steps:
-
# https://github.com/actions/checkout
name: Checkout
uses: actions/checkout@v1
-
# https://github.com/crazy-max/ghaction-github-labeler
name: Run Labeler
if: success()
uses: crazy-max/ghaction-github-labeler@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

74
.github/workflows/test.yml vendored Normal file
View File

@ -0,0 +1,74 @@
name: test
on:
pull_request:
branches: master
paths:
- '.github/workflows/test.yml'
- 'Dockerfile'
- 'entrypoint.sh'
push:
branches: master
paths:
- '.github/workflows/test.yml'
- 'Dockerfile'
- 'entrypoint.sh'
jobs:
test:
runs-on: ubuntu-latest
steps:
-
name: Prepare
id: prepare
run: |
echo ::set-output name=build_tag::test
echo ::set-output name=container_name::jetbrains-license-server
echo ::set-output name=running_timeout::120
echo ::set-output name=running_log_check::is listening on
-
# https://github.com/actions/checkout
name: Checkout
uses: actions/checkout@v1
-
# https://github.com/crazy-max/ghaction-docker-buildx
name: Set up Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
-
name: Docker Buildx
run: |
docker buildx build --load --tag ${{ steps.prepare.outputs.build_tag }} --file Dockerfile .
-
name: Start container
run: |
docker rm -f ${{ steps.prepare.outputs.container_name }} > /dev/null 2>&1 || true
docker run -d --name ${{ steps.prepare.outputs.container_name }} \
-e "JLS_VIRTUAL_HOSTS=docker.test" \
${{ steps.prepare.outputs.build_tag }}
-
name: Test run
run: |
TIMEOUT=$((SECONDS + ${{ steps.prepare.outputs.running_timeout }}))
while read LOGLINE; do
echo ${LOGLINE}
if [[ ${LOGLINE} == *"${{ steps.prepare.outputs.running_log_check }}"* ]]; then
echo "🎉 Container up!"
break
fi
if [[ $SECONDS -gt ${TIMEOUT} ]]; then
>&2 echo "❌ Failed to run ${{ steps.prepare.outputs.container_name }} container"
docker rm -f ${{ steps.prepare.outputs.container_name }} > /dev/null 2>&1 || true
exit 1
fi
done < <(docker logs -f ${{ steps.prepare.outputs.container_name }} 2>&1)
CONTAINER_STATUS=$(docker container inspect --format "{{.State.Status}}" ${{ steps.prepare.outputs.container_name }})
if [[ ${CONTAINER_STATUS} != "running" ]]; then
>&2 echo "❌ Container ${{ steps.prepare.outputs.container_name }} returned status '$CONTAINER_STATUS'"
docker rm -f ${{ steps.prepare.outputs.container_name }} > /dev/null 2>&1 || true
exit 1
fi
docker rm -f ${{ steps.prepare.outputs.container_name }} > /dev/null 2>&1 || true
echo

Binary file not shown.

Before

Width:  |  Height:  |  Size: 7.5 KiB

View File

@ -1,29 +0,0 @@
sudo: required
services:
- docker
env:
global:
- VERSION=20267
- DOCKER_LOGIN=crazymax
- DOCKER_USERNAME=crazymax
- DOCKER_REPONAME=jetbrains-license-server
- QUAY_LOGIN=crazymax
- QUAY_USERNAME=crazymax
- QUAY_REPONAME=jetbrains-license-server
- secure: JwfXiiIM4c6E+80O6XHQBhw6IdkerfGxlKo+YHvmtkHyz5Fvpc1ZRvWSZYHZhxE1gocThbKUCy4GsgIyiq+dsER27kdAnnvp6JLw8SZ5OSqtOOLjqCKilN2hwFaS/g6Xc3mGvTo+4ScAc9CDJamDCwGY+6r2g/+IdmCbgqOo8yaD4VkhP4eVB3f4el6F7jEwjo626QDzFZ1LVS0qmmeVBSU+xxfL5HolG+j//hLQ/49XIIGnsWtQmHbX1u2trSESyNRTFdY/KZ7qaW8l+BgLhplKu+YXAExb1POGcKJnffSJjCl22ggX1JUHANMgrcQfZe2DKkUJFqr8FvTCktj+lfAuMYwl3k24zcZHe8eTyBFh8YLs7pn++tOFWg0XcKCWO9vzHgbTf/m95F6tpDMx4Y49jRclJIslxkjf8YIuNvDOO4kPKp2bw4ymqjsayPLx3P4xB8vgvyAZeFBQevUkh3ia/3uCfwEwzWimlT1FTeDUj8h4A9y+zRy/AqGf35LneC/Sbwt5dNaCujAwOGFeCvTp43uYd10S5Rz026ecH/8XlcHzuH4+nUvXDnesRI79+6NkaKl8PdcTx0ZC44jIAULn60rur5ybNkQmv5GWjem1C24izosPuC8bLHYY6BSRPn+vacNZH9SYTw2wHiVunxZORWz4FsYAidFkoaygt9E= # DOCKER_PASSWORD
- secure: Z+SIP2bLs70GcInLxGdYv68vXD47RIfowafFP8KpVt7EHki6AsIVJxrEH4/noj0jsx0Zyi93xAo+Z9Ms+BDsjUKeLjODS/mHjRQBrnryenjAnS8cRVvJUUDYcoY95SIOO4j6OSEIb+aI2d+6T2QX/iEgnEFDjiia2mLJ60orsWDtgoU7dgITB7ci4WkSMZl8VXtX7SUWKgVPRKkapfYX/AFUS41MZTnJvGQHCtTYlOMcS7fsf6ahjMvbTmf+otv2n688Mbg8Tz3cEw6YD5BHemfDq5qEJqjjnCtMIr5VSZttDwKwHsgmHrVEoiPq+Cdo+xwq3XCdfKu/qAD7NalBjNVaf6UjLjhkk4CWwLxQFnon1e8EC8GodXob4jQTGVOQX47lkPCvf6zM14GI1YxGMtofkv5ND7Ul/g+9fsn+b/QJFsuQb3ZA34pufjQQ5HRaj0ZU7izXIpUOu5EVo5ffrmUnrTisVNaSuIUonEt0p1WPFhdr1ScUc/VukF+wapDdSrSu/t8a5MXp0q3nZ+20NHlkm90o8umQqS8U1oo/n1hlEWTpC4PtRd4wggz0YNGTIKLpuxUt8HolU9rSPbGcbMLC53bNxnWd9KFaaFmRj5Np1GsBm2CDAPFYb3n/Dqyww+tg9Nk4MnCLMwROyZ+5Y7UQLtG5Tsh9tCtwPtT7Juk= # QUAY_PASSWORD
before_install:
- sudo apt-get update
- docker --version
script: ./build.sh
notifications:
email:
recipients:
- travisci@crazymax.dev
on_success: always
on_failure: always

View File

@ -1,5 +1,66 @@
# Changelog # Changelog
## 22218-RC1 (2020/02/04)
* JetBrains License Server 22218
* AdoptOpenJDK JRE 13
## 21137-RC5 (2019/12/07)
* Fix timezone
## 21137-RC4 (2019/11/28)
* Proxy type defaults to `https`
* More unset
## 21137-RC3 (2019/11/28)
* Add env vars to set proxy settings (#21)
* Unset sensitive vars
## 21137-RC2 (2019/11/17)
* Allow to set custom `PUID`/`PGID`
## 21137-RC1 (2019/10/24)
* JetBrains License Server 21137
## 20308-RC4 (2019/10/10)
* Optimize layers
## 20308-RC3 (2019/10/10)
* Multi-platform Docker image
* Switch to GitHub Actions
* :warning: Stop publishing Docker image on Quay
* :warning: Run as non-root user
* Set timezone through tzdata
> :warning: **UPGRADE NOTES**
> As the Docker container now runs as a non-root user, you have to first stop the container and change permissions to `data` volume:
> ```
> docker-compose stop
> chown -R 1000:1000 data/
> docker-compose pull
> docker-compose up -d
> ```
## 20308-RC2 (2019/08/04)
* Add healthcheck
## 20308-RC1 (2019/07/30)
* JetBrains License Server 20308
## 20267-RC2 (2019/07/22)
* OpenJDK JRE 12
* Alpine Linux 3.10
## 20267-RC1 (2019/07/19) ## 20267-RC1 (2019/07/19)
* JetBrains License Server 20267 * JetBrains License Server 20267

View File

@ -1,43 +1,76 @@
FROM openjdk:8-jre-alpine # syntax=docker/dockerfile:experimental
FROM --platform=${TARGETPLATFORM:-linux/amd64} adoptopenjdk:13-jre-hotspot as suexec
ARG BUILD_DATE
ARG VCS_REF
ARG VERSION
ARG TARGETPLATFORM
ARG BUILDPLATFORM
RUN printf "I am running on ${BUILDPLATFORM:-linux/amd64}, building for ${TARGETPLATFORM:-linux/amd64}\n$(uname -a)\n"
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
gcc \
libc-dev \
&& curl -o /usr/local/bin/su-exec.c https://raw.githubusercontent.com/ncopa/su-exec/master/su-exec.c \
&& gcc -Wall /usr/local/bin/su-exec.c -o/usr/local/bin/su-exec \
&& chown root:root /usr/local/bin/su-exec \
&& chmod 0755 /usr/local/bin/su-exec
FROM --platform=${TARGETPLATFORM:-linux/amd64} adoptopenjdk:13-jre-hotspot
ARG BUILD_DATE ARG BUILD_DATE
ARG VCS_REF ARG VCS_REF
ARG VERSION ARG VERSION
LABEL maintainer="CrazyMax" \ LABEL maintainer="CrazyMax" \
org.label-schema.build-date=$BUILD_DATE \ org.opencontainers.image.created=$BUILD_DATE \
org.label-schema.name="jetbrains-license-server" \ org.opencontainers.image.url="https://github.com/crazy-max/docker-jetbrains-license-server" \
org.label-schema.description="JetBrains License Server" \ org.opencontainers.image.source="https://github.com/crazy-max/docker-jetbrains-license-server" \
org.label-schema.version=$VERSION \ org.opencontainers.image.version=$VERSION \
org.label-schema.url="https://github.com/crazy-max/docker-jetbrains-license-server" \ org.opencontainers.image.revision=$VCS_REF \
org.label-schema.vcs-ref=$VCS_REF \ org.opencontainers.image.vendor="CrazyMax" \
org.label-schema.vcs-url="https://github.com/crazy-max/docker-jetbrains-license-server" \ org.opencontainers.image.title="JetBrains License Server" \
org.label-schema.vendor="CrazyMax" \ org.opencontainers.image.description="JetBrains License Server" \
org.label-schema.schema-version="1.0" org.opencontainers.image.licenses="MIT"
ENV JLS_PATH="/opt/jetbrains-license-server" \ ENV JLS_PATH="/opt/jetbrains-license-server" \
JLS_VERSION="20267" \ JLS_VERSION="22218" \
JLS_SHA256="5a32e66a05cc52c6ca030de4507b04afedff564e65c47e2fbfe3e7439ab611aa" JLS_SHA256="f68027a8b2b4f2d9b03fe0b0fef4a9ffc0fdfaf2657ab26d545777973311b601" \
TZ="UTC" \
PUID="1000" \
PGID="1000"
COPY entrypoint.sh /entrypoint.sh RUN apt-get update \
&& apt-get install -y \
RUN apk --update --no-cache add \ bash \
curl \
zip \
tzdata \ tzdata \
&& apk --update --no-cache add -t build-dependencies \ && mkdir -p /data "$JLS_PATH" \
curl zip \
&& mkdir -p "$JLS_PATH" \
&& curl -L "https://download.jetbrains.com/lcsrv/license-server-installer.zip" -o "/tmp/jls.zip" \ && curl -L "https://download.jetbrains.com/lcsrv/license-server-installer.zip" -o "/tmp/jls.zip" \
&& echo "$JLS_SHA256 /tmp/jls.zip" | sha256sum -c - | grep OK \ && echo "$JLS_SHA256 /tmp/jls.zip" | sha256sum -c - | grep OK \
&& unzip "/tmp/jls.zip" -d "$JLS_PATH" \ && unzip "/tmp/jls.zip" -d "$JLS_PATH" \
&& rm -f "/tmp/jls.zip" \ && rm -f "/tmp/jls.zip" \
&& chmod a+x "$JLS_PATH/bin/license-server.sh" \ && chmod a+x "$JLS_PATH/bin/license-server.sh" \
&& ln -sf "$JLS_PATH/bin/license-server.sh" "/usr/local/bin/license-server" \ && ln -sf "$JLS_PATH/bin/license-server.sh" "/usr/local/bin/license-server" \
&& chmod a+x /entrypoint.sh \ && groupadd -f -g ${PGID} jls \
&& apk del build-dependencies \ && useradd -o -s /bin/bash -d /data -u ${PUID} -g jls -m jls \
&& rm -rf /var/cache/apk/* /tmp/* && chown -R jls. /data "$JLS_PATH" \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
COPY --from=suexec /usr/local/bin/su-exec /usr/local/bin/su-exec
COPY entrypoint.sh /entrypoint.sh
RUN chmod a+x /entrypoint.sh
EXPOSE 8000 EXPOSE 8000
WORKDIR /data
VOLUME [ "/data" ] VOLUME [ "/data" ]
ENTRYPOINT [ "/entrypoint.sh" ] ENTRYPOINT [ "/entrypoint.sh" ]
CMD [ "/usr/local/bin/license-server", "run" ] CMD [ "/usr/local/bin/license-server", "run" ]
HEALTHCHECK --interval=10s --timeout=5s \
CMD license-server status || exit 1

View File

@ -1,6 +1,6 @@
MIT License MIT License
Copyright (c) 2018-2019 CrazyMax Copyright (c) 2018-2020 CrazyMax
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,38 +1,59 @@
<p align="center"><a href="https://github.com/crazy-max/docker-jetbrains-license-server" target="_blank"><img height="128" src="https://raw.githubusercontent.com/crazy-max/docker-jetbrains-license-server/master/.res/docker-jetbrains-license-server.jpg"></a></p> <p align="center"><a href="https://github.com/crazy-max/docker-jetbrains-license-server" target="_blank"><img height="128" src="https://raw.githubusercontent.com/crazy-max/docker-jetbrains-license-server/master/.res/docker-jetbrains-license-server.jpg"></a></p>
<p align="center"> <p align="center">
<a href="https://hub.docker.com/r/crazymax/jetbrains-license-server/"><img src="https://img.shields.io/badge/dynamic/json.svg?label=version&query=$.results[1].name&url=https://hub.docker.com/v2/repositories/crazymax/jetbrains-license-server/tags&style=flat-square" alt="Latest Version"></a> <a href="https://hub.docker.com/r/crazymax/jetbrains-license-server/tags?page=1&ordering=last_updated"><img src="https://img.shields.io/github/v/tag/crazy-max/docker-jetbrains-license-server?label=version&style=flat-square" alt="Latest Version"></a>
<a href="https://travis-ci.com/crazy-max/docker-jetbrains-license-server"><img src="https://img.shields.io/travis/com/crazy-max/docker-jetbrains-license-server/master.svg?style=flat-square" alt="Build Status"></a> <a href="https://github.com/crazy-max/docker-jetbrains-license-server/actions?workflow=build"><img src="https://github.com/crazy-max/docker-jetbrains-license-server/workflows/build/badge.svg" alt="Build Status"></a>
<a href="https://hub.docker.com/r/crazymax/jetbrains-license-server/"><img src="https://img.shields.io/docker/stars/crazymax/jetbrains-license-server.svg?style=flat-square" alt="Docker Stars"></a> <a href="https://hub.docker.com/r/crazymax/jetbrains-license-server/"><img src="https://img.shields.io/docker/stars/crazymax/jetbrains-license-server.svg?style=flat-square" alt="Docker Stars"></a>
<a href="https://hub.docker.com/r/crazymax/jetbrains-license-server/"><img src="https://img.shields.io/docker/pulls/crazymax/jetbrains-license-server.svg?style=flat-square" alt="Docker Pulls"></a> <a href="https://hub.docker.com/r/crazymax/jetbrains-license-server/"><img src="https://img.shields.io/docker/pulls/crazymax/jetbrains-license-server.svg?style=flat-square" alt="Docker Pulls"></a>
<a href="https://quay.io/repository/crazymax/jetbrains-license-server"><img src="https://quay.io/repository/crazymax/jetbrains-license-server/status?style=flat-square" alt="Docker Repository on Quay"></a>
<a href="https://www.codacy.com/app/crazy-max/docker-jetbrains-license-server"><img src="https://img.shields.io/codacy/grade/eb420bc3e6ed49ff97cc261602228efa.svg?style=flat-square" alt="Code Quality"></a> <a href="https://www.codacy.com/app/crazy-max/docker-jetbrains-license-server"><img src="https://img.shields.io/codacy/grade/eb420bc3e6ed49ff97cc261602228efa.svg?style=flat-square" alt="Code Quality"></a>
<a href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3BXL8EBDJALHQ"><img src="https://img.shields.io/badge/donate-paypal-7057ff.svg?style=flat-square" alt="Donate Paypal"></a> <br /><a href="https://github.com/sponsors/crazy-max"><img src="https://img.shields.io/badge/sponsor-crazy--max-181717.svg?logo=github&style=flat-square" alt="Become a sponsor"></a>
<a href="https://www.paypal.me/crazyws"><img src="https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal&style=flat-square" alt="Donate Paypal"></a>
</p> </p>
## About ## About
🐳 [JetBrains License Server](https://www.jetbrains.com/help/license_server/getting_started.html) Docker image based on Alpine Linux.<br /> 🐳 [JetBrains License Server](https://www.jetbrains.com/help/license_server/getting_started.html) Docker image based on AdoptOpenJDK.<br />
If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other 🐳 Docker images! If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other 🐳 Docker images!
💡 Want to be notified of new releases? Check out 🔔 [Diun (Docker Image Update Notifier)](https://github.com/crazy-max/diun) project!
## Features ## Features
### Included * Run as non-root user
* 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 (see [this template](examples/traefik))
### From docker-compose
* [Traefik](https://github.com/containous/traefik-library-image) as reverse proxy and creation/renewal of Let's Encrypt certificates
## Docker ## Docker
### Multi-platform image
Following platforms for this image are available:
```
$ docker run --rm mplatform/mquery crazymax/jetbrains-license-server:latest
Image: crazymax/jetbrains-license-server:latest
* Manifest List: Yes
* Supported platforms:
- linux/amd64
- linux/arm64
- linux/ppc64le
- linux/s390x
```
### Environment variables ### Environment variables
* `TZ`: The timezone assigned to the container (default `UTC`) * `TZ`: The timezone assigned to the container (default `UTC`)
* `PUID`: JLS UID (default `1000`)
* `PGID`: JLS GID (default `1000`)
* `JLS_VIRTUAL_HOSTS`: [Virtual hosts](https://www.jetbrains.com/help/license_server/setting_host_and_port.html#d1010e63) where license server will be available (comma delimited for several hosts) * `JLS_VIRTUAL_HOSTS`: [Virtual hosts](https://www.jetbrains.com/help/license_server/setting_host_and_port.html#d1010e63) where license server will be available (comma delimited for several hosts)
* `JLS_CONTEXT`: [Context path](https://www.jetbrains.com/help/license_server/setting_host_and_port.html#d1010e63) used by the license server (default `/`) * `JLS_CONTEXT`: [Context path](https://www.jetbrains.com/help/license_server/setting_host_and_port.html#d1010e63) used by the license server (default `/`)
* `JLS_PROXY_TYPE`: Type of [proxy](https://www.jetbrains.com/help/license_server/configuring_proxy_settings.html) to use. Can be `http` or `https` (default `https`)
* `JLS_PROXY_HOST`: The host name of your proxy server
* `JLS_PROXY_PORT`: The port number that the proxy server listens to
* `JLS_PROXY_USER`: Username to connect to the proxy server (no auth if empty)
* `JLS_PROXY_PASSWORD`: Password to connect to the proxy server (no auth if empty)
* `JLS_ACCESS_CONFIG`: JSON file to configure [user restrictions](https://www.jetbrains.com/help/license_server/configuring_user_restrictions.html) (default `/data/access-config.json`) * `JLS_ACCESS_CONFIG`: JSON file to configure [user restrictions](https://www.jetbrains.com/help/license_server/configuring_user_restrictions.html) (default `/data/access-config.json`)
* `JLS_STATS_RECIPIENTS`: [Reports recipients](https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html#d461e40) email addresses for stats (comma delimited) * `JLS_STATS_RECIPIENTS`: [Reports recipients](https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html#d461e40) email addresses for stats (comma delimited)
* `JLS_REPORT_OUT_OF_LICENSE`: [Warn about lack of licenses](https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html#d461e40) every hour following the percentage threshold (default `0`) * `JLS_REPORT_OUT_OF_LICENSE`: [Warn about lack of licenses](https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html#d461e40) every hour following the percentage threshold (default `0`)
@ -47,6 +68,8 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other
* `/data`: Contains [registration data](https://www.jetbrains.com/help/license_server/migrate.html) and configuration * `/data`: Contains [registration data](https://www.jetbrains.com/help/license_server/migrate.html) and configuration
> :warning: Note that the volumes should be owned by the user/group with the specified `PUID` and `PGID`. If you don't give the volume correct permissions, the container may not start.
### Ports ### Ports
* `8000`: Jetbrains License Server HTTP port * `8000`: Jetbrains License Server HTTP port
@ -58,8 +81,6 @@ If you are interested, [check out](https://hub.docker.com/r/crazymax/) my other
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
``` ```
@ -71,14 +92,14 @@ 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
``` ```
## Update ## Update
Recreate the container whenever i push an update : Recreate the container whenever I push an update:
```bash ```bash
docker-compose pull docker-compose pull
@ -101,11 +122,9 @@ That's because the license server is running behind a reverse proxy. Please conf
## How can I help ? ## How can I help ?
All kinds of contributions are welcome :raised_hands:!<br /> All kinds of contributions are welcome :raised_hands:! The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon: You can also support this project by [**becoming a sponsor on GitHub**](https://github.com/sponsors/crazy-max) :clap: or by making a [Paypal donation](https://www.paypal.me/crazyws) to ensure this journey continues indefinitely! :rocket:
The most basic way to show your support is to star :star2: the project, or to raise issues :speech_balloon:<br />
But we're not gonna lie to each other, I'd rather you buy me a beer or two :beers:!
[![Paypal](.res/paypal.png)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=3BXL8EBDJALHQ) Thanks again for your support, it is much appreciated! :pray:
## License ## License

121
build.sh
View File

@ -1,121 +0,0 @@
#!/usr/bin/env bash
set -e
PROJECT=jetbrains-license-server
BUILD_DATE=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
BUILD_TAG=docker_build
BUILD_WORKINGDIR=${BUILD_WORKINGDIR:-.}
DOCKERFILE=${DOCKERFILE:-Dockerfile}
VCS_REF=${TRAVIS_COMMIT::7}
RUNNING_TIMEOUT=120
RUNNING_LOG_CHECK="is listening on"
PUSH_LATEST=${PUSH_LATEST:-true}
DOCKER_USERNAME=${DOCKER_USERNAME:-crazymax}
DOCKER_LOGIN=${DOCKER_LOGIN:-crazymax}
DOCKER_REPONAME=${DOCKER_REPONAME:-jetbrains-license-server}
QUAY_USERNAME=${QUAY_USERNAME:-crazymax}
QUAY_LOGIN=${QUAY_LOGIN:-crazymax}
QUAY_REPONAME=${QUAY_REPONAME:-jetbrains-license-server}
# Check local or travis
BRANCH=${TRAVIS_BRANCH:-local}
if [[ ${TRAVIS_PULL_REQUEST} == "true" ]]; then
BRANCH=${TRAVIS_PULL_REQUEST_BRANCH}
fi
DOCKER_TAG=${BRANCH:-local}
if [[ "$BRANCH" == "master" ]]; then
DOCKER_TAG=latest
elif [[ "$BRANCH" == "local" ]]; then
BUILD_DATE=
VERSION=local
fi
echo "PROJECT=${PROJECT}"
echo "VERSION=${VERSION}"
echo "BUILD_DATE=${BUILD_DATE}"
echo "BUILD_TAG=${BUILD_TAG}"
echo "BUILD_WORKINGDIR=${BUILD_WORKINGDIR}"
echo "DOCKERFILE=${DOCKERFILE}"
echo "VCS_REF=${VCS_REF}"
echo "PUSH_LATEST=${PUSH_LATEST}"
echo "DOCKER_LOGIN=${DOCKER_LOGIN}"
echo "DOCKER_USERNAME=${DOCKER_USERNAME}"
echo "DOCKER_REPONAME=${DOCKER_REPONAME}"
echo "QUAY_LOGIN=${QUAY_LOGIN}"
echo "QUAY_USERNAME=${QUAY_USERNAME}"
echo "QUAY_REPONAME=${QUAY_REPONAME}"
echo "TRAVIS_BRANCH=${TRAVIS_BRANCH}"
echo "TRAVIS_PULL_REQUEST=${TRAVIS_PULL_REQUEST}"
echo "BRANCH=${BRANCH}"
echo "DOCKER_TAG=${DOCKER_TAG}"
echo
# Build
echo "### Build"
docker build \
--build-arg BUILD_DATE=${BUILD_DATE} \
--build-arg VCS_REF=${VCS_REF} \
--build-arg VERSION=${VERSION} \
-t ${BUILD_TAG} -f ${DOCKERFILE} ${BUILD_WORKINGDIR}
echo
echo "### Test"
docker rm -f ${PROJECT} > /dev/null 2>&1 || true
docker run -d -p 8000:8000 \
-e "JLS_VIRTUAL_HOSTS=docker.test" \
--name ${PROJECT} ${BUILD_TAG}
echo
echo "### Waiting for ${PROJECT} to be up..."
TIMEOUT=$((SECONDS + RUNNING_TIMEOUT))
while read LOGLINE; do
echo ${LOGLINE}
if [[ ${LOGLINE} == *"${RUNNING_LOG_CHECK}"* ]]; then
echo "Container up!"
break
fi
if [[ $SECONDS -gt ${TIMEOUT} ]]; then
>&2 echo "ERROR: Failed to run ${PROJECT} container"
docker rm -f ${PROJECT} > /dev/null 2>&1 || true
exit 1
fi
done < <(docker logs -f ${PROJECT} 2>&1)
echo
CONTAINER_STATUS=$(docker container inspect --format "{{.State.Status}}" ${PROJECT})
if [[ ${CONTAINER_STATUS} != "running" ]]; then
>&2 echo "ERROR: Container ${PROJECT} returned status '$CONTAINER_STATUS'"
docker rm -f ${PROJECT} > /dev/null 2>&1 || true
exit 1
fi
docker rm -f ${PROJECT} > /dev/null 2>&1 || true
if [ "${VERSION}" == "local" -o "${TRAVIS_PULL_REQUEST}" == "true" ]; then
echo "INFO: This is a PR or a local build, skipping push..."
exit 0
fi
if [[ ! -z ${DOCKER_PASSWORD} ]]; then
echo "### Push to Docker Hub..."
echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_LOGIN" --password-stdin > /dev/null 2>&1
if [ "${DOCKER_TAG}" == "latest" -a "${PUSH_LATEST}" == "true" ]; then
docker tag ${BUILD_TAG} ${DOCKER_USERNAME}/${DOCKER_REPONAME}:${DOCKER_TAG}
fi
if [[ "${VERSION}" != "latest" ]]; then
docker tag ${BUILD_TAG} ${DOCKER_USERNAME}/${DOCKER_REPONAME}:${VERSION}
fi
docker push ${DOCKER_USERNAME}/${DOCKER_REPONAME}
echo
fi
if [[ ! -z ${QUAY_PASSWORD} ]]; then
echo "### Push to Quay..."
echo "$QUAY_PASSWORD" | docker login quay.io --username "$QUAY_LOGIN" --password-stdin > /dev/null 2>&1
if [ "${DOCKER_TAG}" == "latest" -a "${PUSH_LATEST}" == "true" ]; then
docker tag ${BUILD_TAG} quay.io/${QUAY_USERNAME}/${QUAY_REPONAME}:${DOCKER_TAG}
fi
if [[ "${VERSION}" != "latest" ]]; then
docker tag ${BUILD_TAG} quay.io/${QUAY_USERNAME}/${QUAY_REPONAME}:${VERSION}
fi
docker push quay.io/${QUAY_USERNAME}/${QUAY_REPONAME}
echo
fi

View File

@ -1,11 +1,23 @@
#!/bin/sh #!/bin/sh
TZ=${TZ:-UTC} TZ=${TZ:-UTC}
JLS_PATH="/opt/jetbrains-license-server" JLS_PATH="/opt/jetbrains-license-server"
JLS_LISTEN_ADDRESS="0.0.0.0" JLS_LISTEN_ADDRESS="0.0.0.0"
JLS_PORT=8000 JLS_PORT=8000
JLS_CONTEXT=${JLS_CONTEXT:-/} JLS_CONTEXT=${JLS_CONTEXT:-/}
JLS_ACCESS_CONFIG=${JLS_ACCESS_CONFIG:-/data/access-config.json} JLS_ACCESS_CONFIG=${JLS_ACCESS_CONFIG:-/data/access-config.json}
JLS_PROXY_TYPE=${JLS_PROXY_TYPE:-https}
if [ -n "${PGID}" ] && [ "${PGID}" != "$(id -g jls)" ]; then
echo "Switching to PGID ${PGID}..."
sed -i -e "s/^jls:\([^:]*\):[0-9]*/jls:\1:${PGID}/" /etc/group
sed -i -e "s/^jls:\([^:]*\):\([0-9]*\):[0-9]*/jls:\1:\2:${PGID}/" /etc/passwd
fi
if [ -n "${PUID}" ] && [ "${PUID}" != "$(id -u jls)" ]; then
echo "Switching to PUID ${PUID}..."
sed -i -e "s/^jls:\([^:]*\):[0-9]*:\([0-9]*\)/jls:\1:${PUID}:\2/" /etc/passwd
fi
# Timezone # Timezone
echo "Setting timezone to ${TZ}..." echo "Setting timezone to ${TZ}..."
@ -14,13 +26,11 @@ echo ${TZ} > /etc/timezone
# Init # Init
echo "Initializing files and folders..." echo "Initializing files and folders..."
mkdir -p /data/registration su-exec jls:jls touch "/data/access-config.json"
ln -sf "/data/registration" "/root/.jb-license-server"
touch "/data/access-config.json"
# https://www.jetbrains.com/help/license_server/setting_host_and_port.html # https://www.jetbrains.com/help/license_server/setting_host_and_port.html
echo "Configuring Jetbrains License Server..." echo "Configuring Jetbrains License Server..."
license-server configure --listen ${JLS_LISTEN_ADDRESS} --port ${JLS_PORT} --context ${JLS_CONTEXT} su-exec jls:jls license-server configure --listen ${JLS_LISTEN_ADDRESS} --port ${JLS_PORT} --context ${JLS_CONTEXT}
# https://www.jetbrains.com/help/license_server/setting_host_and_port.html # https://www.jetbrains.com/help/license_server/setting_host_and_port.html
if [ ! -z "$JLS_VIRTUAL_HOSTS" ]; then if [ ! -z "$JLS_VIRTUAL_HOSTS" ]; then
@ -28,45 +38,68 @@ if [ ! -z "$JLS_VIRTUAL_HOSTS" ] ; then
for JLS_VIRTUAL_HOST in $(echo ${JLS_VIRTUAL_HOSTS} | tr "," "\n"); do for JLS_VIRTUAL_HOST in $(echo ${JLS_VIRTUAL_HOSTS} | tr "," "\n"); do
echo "-> ${JLS_VIRTUAL_HOST}" echo "-> ${JLS_VIRTUAL_HOST}"
done done
license-server configure --jetty.virtualHosts.names=${JLS_VIRTUAL_HOSTS} su-exec jls:jls license-server configure --jetty.virtualHosts.names=${JLS_VIRTUAL_HOSTS}
fi fi
# https://www.jetbrains.com/help/license_server/configuring_proxy_settings.html
if [ ! -z "$JLS_PROXY_HOST" -a ! -z "$JLS_PROXY_PORT" ]; then
echo "Setting ${JLS_PROXY_TYPE} proxy to $JLS_PROXY_HOST:$JLS_PROXY_PORT..."
su-exec jls:jls license-server configure \
-J-D${JLS_PROXY_TYPE}.proxyHost=${JLS_PROXY_HOST} \
-J-D${JLS_PROXY_TYPE}.proxyPort=${JLS_PROXY_PORT}
if [ ! -z "$JLS_PROXY_USER" -a ! -z "$JLS_PROXY_PASSWORD" ]; then
echo "Setting ${JLS_PROXY_TYPE} proxy credentials..."
su-exec jls:jls license-server configure \
-J-D${JLS_PROXY_TYPE}.proxyUser=${JLS_PROXY_USER} \
-J-D${JLS_PROXY_TYPE}.proxyPassword=${JLS_PROXY_PASSWORD}
fi
fi
unset JLS_PROXY_USER
unset JLS_PROXY_PASSWORD
# https://www.jetbrains.com/help/license_server/configuring_user_restrictions.html # https://www.jetbrains.com/help/license_server/configuring_user_restrictions.html
if [ -s "$JLS_ACCESS_CONFIG" ]; then if [ -s "$JLS_ACCESS_CONFIG" ]; then
echo "Enabling user restrictions access from $JLS_ACCESS_CONFIG..." echo "Enabling user restrictions access from $JLS_ACCESS_CONFIG..."
license-server configure --access.config=file:${JLS_ACCESS_CONFIG} su-exec jls:jls license-server configure --access.config=file:${JLS_ACCESS_CONFIG}
fi fi
# https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html # https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html
if [ ! -z "$JLS_SMTP_SERVER" -a ! -z "$JLS_STATS_RECIPIENTS" ]; then if [ ! -z "$JLS_SMTP_SERVER" -a ! -z "$JLS_STATS_RECIPIENTS" ]; then
JLS_SMTP_PORT=${JLS_SMTP_PORT:-25} JLS_SMTP_PORT=${JLS_SMTP_PORT:-25}
echo "Enabling User Reporting via SMTP at $JLS_SMTP_SERVER:$JLS_SMTP_PORT..." echo "Enabling User Reporting via SMTP at $JLS_SMTP_SERVER:$JLS_SMTP_PORT..."
license-server configure --smtp.server ${JLS_SMTP_SERVER} --smtp.server.port ${JLS_SMTP_PORT} su-exec jls:jls license-server configure --smtp.server ${JLS_SMTP_SERVER} --smtp.server.port ${JLS_SMTP_PORT}
if [ ! -z "$JLS_SMTP_USERNAME" -a ! -z "$JLS_SMTP_PASSWORD" ]; then if [ ! -z "$JLS_SMTP_USERNAME" -a ! -z "$JLS_SMTP_PASSWORD" ]; then
echo "Using SMTP username $JLS_SMTP_USERNAME with password..." echo "Using SMTP username $JLS_SMTP_USERNAME with password..."
license-server configure --smtp.server.username ${JLS_SMTP_USERNAME} su-exec jls:jls license-server configure --smtp.server.username ${JLS_SMTP_USERNAME}
license-server configure --smtp.server.password ${JLS_SMTP_PASSWORD} su-exec jls:jls license-server configure --smtp.server.password ${JLS_SMTP_PASSWORD}
fi fi
unset JLS_SMTP_USERNAME
unset JLS_SMTP_PASSWORD
if [ ! -z "$JLS_STATS_FROM" ]; then if [ ! -z "$JLS_STATS_FROM" ]; then
echo "Setting stats sender to $JLS_STATS_FROM..." echo "Setting stats sender to $JLS_STATS_FROM..."
license-server configure --stats.from ${JLS_STATS_FROM} su-exec jls:jls license-server configure --stats.from ${JLS_STATS_FROM}
fi fi
if [ "$JLS_REPORT_OUT_OF_LICENSE" -gt 0 ]; then if [ "$JLS_REPORT_OUT_OF_LICENSE" -gt 0 ]; then
echo "Setting report out of licence to $JLS_REPORT_OUT_OF_LICENSE%..." echo "Setting report out of licence to $JLS_REPORT_OUT_OF_LICENSE%..."
license-server configure --reporting.out.of.license.threshold ${JLS_REPORT_OUT_OF_LICENSE} su-exec jls:jls license-server configure --reporting.out.of.license.threshold ${JLS_REPORT_OUT_OF_LICENSE}
fi fi
echo "Stats recipients: $JLS_STATS_RECIPIENTS..." echo "Stats recipients: $JLS_STATS_RECIPIENTS..."
license-server configure --stats.recipients ${JLS_STATS_RECIPIENTS} su-exec jls:jls license-server configure --stats.recipients ${JLS_STATS_RECIPIENTS}
fi fi
# https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html # https://www.jetbrains.com/help/license_server/detailed_server_usage_statistics.html
if [ ! -z "$JLS_STATS_TOKEN" ]; then if [ ! -z "$JLS_STATS_TOKEN" ]; then
echo "Enabling stats via API at /$JLS_STATS_TOKEN..." echo "Enabling stats via API at /$JLS_STATS_TOKEN..."
license-server configure --reporting.token ${JLS_STATS_TOKEN} su-exec jls:jls license-server configure --reporting.token ${JLS_STATS_TOKEN}
fi fi
unset JLS_STATS_TOKEN
exec "$@" echo "Fixing perms..."
chown -R jls:jls /data "$JLS_PATH"
exec su-exec jls:jls "$@"

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

3
heroku.yml Normal file
View File

@ -0,0 +1,3 @@
build:
docker:
web: Dockerfile