-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #192 from entur/docker-examples
Add docker-compose example
- Loading branch information
Showing
6 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM eclipse-temurin:17.0.6_10-jdk-alpine | ||
|
||
RUN apk update && apk upgrade && apk add --no-cache \ | ||
tini | ||
|
||
RUN addgroup appuser && adduser --disabled-password appuser --ingroup appuser | ||
USER appuser | ||
|
||
WORKDIR /home/appuser | ||
|
||
RUN chown -R appuser:appuser /home/appuser | ||
USER appuser | ||
|
||
COPY target/lamassu-0.0.1-SNAPSHOT.jar lamassu.jar | ||
|
||
CMD [ "/sbin/tini", "--", "java", "-jar", "lamassu.jar" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# Docker examples for lamassu | ||
|
||
This directory contains docker-compose examples for lamassu. | ||
|
||
## Usage | ||
|
||
Make sure you have built lamassu (check for jar file in `..target/`). | ||
|
||
Edit `application-config/feedproviders.yml` so that it contains at least one source feed. | ||
|
||
The run docker-compose: | ||
|
||
docker-compose -f docker-compose-simple.yml up | ||
|
||
or | ||
|
||
docker-compose -f docker-compose-advanced.yml up | ||
|
||
The difference between simple and advanced is that simple runs a single instance of lamassu, whereas | ||
advanced runs two instances, one which is responsible for fetching data from upstream sources and updating | ||
caches (leader), and one which responds to API requests. The second instance may be scaled horizontally, but | ||
the leader can only have one instance, and must be scaled vertically if needed. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# Spring Actuator | ||
management.server.port=9001 | ||
management.endpoints.enabled-by-default=false | ||
management.endpoint.info.enabled=true | ||
management.endpoint.health.enabled=true | ||
management.endpoint.health.group.readiness.include=readinessState | ||
management.endpoint.prometheus.enabled=true | ||
management.endpoints.web.exposure.include=info,health,prometheus | ||
management.health.redis.enabled=true | ||
|
||
# Logging | ||
logging.level.no.entur.lamassu=DEBUG | ||
|
||
# Redis | ||
org.entur.lamassu.redis.master.host=redis | ||
org.entur.lamassu.redis.master.port=6379 | ||
org.entur.lamassu.redis.slave.enabled=false | ||
#org.entur.lamassu.redis.slave.host= | ||
#org.entur.lamassu.redis.slave.port= | ||
|
||
# graphql starter | ||
graphiql.enabled=true | ||
graphql.servlet.actuator-metrics=true | ||
graphql.servlet.corsEnabled=false | ||
|
||
# spring boot | ||
# Enable response compression and http2 | ||
server.compression.enabled=true | ||
server.compression.mime-types=text/html,text/xml,text/plain,text/css,text/javascript,application/javascript,application/json | ||
server.compression.min-response-size=1024 | ||
server.http2.enabled=true | ||
server.tomcat.keep-alive-timeout=120000 | ||
|
||
# Graceful shutdown of server | ||
server.shutdown=graceful | ||
|
||
# Application configuration | ||
|
||
## Where to find configured feed providers | ||
org.entur.lamassu.feedproviders=file:/etc/application-config/feedproviders.yml | ||
|
||
## The target GBFS version (in output feeds) | ||
org.entur.lamassu.targetGbfsVersion=2.3 | ||
|
||
## Base URL for API (needed for URL transformations) | ||
org.entur.lamassu.baseUrl=http://localhost:8080 | ||
|
||
## Host / IP of internal load balancer for internal endpoints (Entur) | ||
org.entur.lamassu.internalLoadBalancer=http://localhost:8080 | ||
|
||
org.entur.lamassu.serializationVersion=1 | ||
|
||
## Enable validation for all feeds | ||
org.entur.lamassu.enableValidation=true | ||
|
||
## Control filtering of virtual stations | ||
org.entur.lamassu.excludeVirtualStations=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
lamassu: | ||
providers: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
services: | ||
redis: | ||
image: "redis:alpine" | ||
lamassu: | ||
build: | ||
context: ../ | ||
dockerfile: ./docker-compose/Dockerfile.example | ||
ports: | ||
- "8080:8080" | ||
- "9001:9001" | ||
environment: | ||
JDK_JAVA_OPTIONS: | ||
-Dspring.config.location=/etc/application-config/application.properties | ||
volumes: | ||
- ./application-config:/etc/application-config | ||
lamassu-leader: | ||
build: | ||
context: ../ | ||
dockerfile: ./docker-compose/Dockerfile.example | ||
ports: | ||
- "8081:8080" | ||
- "9002:9001" | ||
environment: | ||
JDK_JAVA_OPTIONS: | ||
-Dspring.config.location=/etc/application-config/application.properties | ||
-Dspring.profiles.active=leader | ||
-Dorg.entur.lamassu.adminPassword=secret | ||
volumes: | ||
- ./application-config:/etc/application-config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
services: | ||
redis: | ||
image: "redis:alpine" | ||
lamassu: | ||
build: | ||
context: ../ | ||
dockerfile: ./docker-compose/Dockerfile.example | ||
ports: | ||
- "8080:8080" | ||
- "9001:9001" | ||
environment: | ||
JDK_JAVA_OPTIONS: | ||
-Dspring.config.location=/etc/application-config/application.properties | ||
-Dspring.profiles.active=leader | ||
-Dorg.entur.lamassu.adminPassword=secret | ||
volumes: | ||
- ./application-config:/etc/application-config |