Skip to content

Commit

Permalink
#822 Docker & Docker Compose installation
Browse files Browse the repository at this point in the history
  • Loading branch information
dcoraboeuf committed Nov 22, 2020
1 parent 87777b2 commit 2de4b02
Show file tree
Hide file tree
Showing 6 changed files with 100 additions and 1 deletion.
2 changes: 1 addition & 1 deletion compose/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
restart: always
environment:
PROFILE: prod
JAVA_OPTIONS: "-Xms1024m -Xmx1024m"
JAVA_OPTIONS: "${JAVA_OPTIONS:--Xms1024m -Xmx1024m}"
SPRING_DATASOURCE_URL: "jdbc:postgresql://postgres/ontrack"
SPRING_ELASTICSEARCH_REST_URIS: "http://elasticsearch:9200"
depends_on:
Expand Down
2 changes: 2 additions & 0 deletions ontrack-docs/src/docs/asciidoc/.gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/generated
*.png
*.svg
3 changes: 3 additions & 0 deletions ontrack-docs/src/docs/asciidoc/installation-dependencies.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[[installation-dependencies]]
=== Installation dependencies

43 changes: 43 additions & 0 deletions ontrack-docs/src/docs/asciidoc/installation-docker-compose.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[[installation-docker-compose]]
=== Docker Compose installation

The fastest way to start Ontrack is to use Docker Compose, but it might not be
the best way to run it in production.

The Docker Compose file can be downloaded from:

https://github.com/nemerosa/ontrack/blob/{ontrack-version}/compose/docker-compose.yml

You can simply run it using:

[source,bash]
----
docker-compose up -d
----

This starts three services:

* Ontrack itself at http://localhost:8080
* a Postgres database
* an Elasticsearch single node

Neither Postgres or Elasticsearch are exposed by default, but you can of course
edit the Docker Compose file at your convenience.

The version of Ontrack is set by default to `4` (latest 4.x version) but
you can override it using the `ONTRACK_VERSION` environment variable.

The memory settings and other JVM parameters for Ontrack can be passed
using the `JAVA_OPTIONS` environment variable, which defaults to
`-Xms1024m -Xmx1024m`.

Other <<configuration-properties,Ontrack configuration properties>> must be passed
through environment variables.

Three named Docker volumes are created for the data to be persisted:

* `ontrack_postgres`
* `ontrack_elasticsearch`
* `ontrack_data`

For other volume configuration, please edit the Docker Compose file.
43 changes: 43 additions & 0 deletions ontrack-docs/src/docs/asciidoc/installation-docker.adoc
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
[[installation-docker]]
=== Docker installation

The Ontrack Docker image is available in the Docker Hub
at https://hub.docker.com/r/nemerosa/ontrack.

Each specific version is available and also a "latest" version per major and minor
version. For example:

* 4
* 4.0
* 4.0.0

To run Ontrack, you need to make sure that the minimal <<installation-dependencies,dependencies>> are available:

* Postgres
* Elasticsearch

NOTE: See <<installation-dependencies>> for details.

You can then run Ontrack using:

[source,bash]
----
docker container run \
--detach \
--publish 8080:8080 \
-e SPRING_DATASOURCE_URL=<Postgres Ontrack DB JDBC URL> \
-e SPRING_DATASOURCE_USERNAME=<Postgres Ontrack DB Username> \
-e SPRING_DATASOURCE_PASSWORD=<Postgres Ontrack DB Password> \
-e SPRING_ELASTICSEARCH_REST_URIS=<Elasticsearch URL> \
nemerosa/ontrack:4
----

The memory settings and other JVM parameters for Ontrack can be passed
using the `JAVA_OPTIONS` environment variable.

Other <<configuration-properties,Ontrack configuration properties>> must be passed
through environment variables.

Optionally, a volume can be mapped to the Ontrack `/var/ontrack/data` Docker
volume. This is particularly needed when using a secret storage based on the
file system (see <<setup>>).
8 changes: 8 additions & 0 deletions ontrack-docs/src/docs/asciidoc/installation.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,14 @@

There are several ways to install Ontrack.

include::installation-docker-compose.adoc[]

include::installation-docker.adoc[]

include::installation-package.adoc[]

include::installation-dependencies.adoc[]

//[[installation-prerequisites]]
//=== Prerequisites
//
Expand Down

0 comments on commit 2de4b02

Please sign in to comment.