ecos-gateway-app
Purpose:
Image of one of the central components of the microservice architecture. The application implements an API gateway for interacting with other microservices
Tags:
Nexus_gateway <tag> - ecos-gateway project build
Docker Compose service template:
gateway-app:
logging:
options:
max-size: "10m"
max-file: "5"
image: nexus.citeck.ru/ecos-gateway:<GATEWAY_APP_IMAGE
container_name: gateway-app
hostname: gateway-app
restart: unless-stopped
stop_grace_period: 1m
environment:
- JHIPSTER_REGISTRY_PASSWORD=alfr3sc0
- _JAVA_OPTIONS=-Xmx512m -Xms256m
- SPRING_PROFILES_ACTIVE=prod,swagger
- EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE=http://admin:$${jhipster.registry.password}@jhipster-registry:8761/eureka
- SPRING_CLOUD_CONFIG_URI=http://admin:$${jhipster.registry.password}@jhipster-registry:8761/config
- SPRING_DATASOURCE_URL=jdbc:postgresql://micro-postgresql:5432/gateway
- JHIPSTER_SLEEP=30 # gives time for the JHipster Registry to boot before the application
expose:
- 8085/tcp
networks:
- app_network
depends_on:
- jhipster-registry
- micro-postgresql
micro-postgresql:
image: postgres:10.4
container_name: micro-postgresql
hostname: micro-postgresql
restart: unless-stopped
stop_grace_period: 1m
environment:
- POSTGRES_USER=gateway
- POSTGRES_PASSWORD=
networks:
- app_network
Used variables:
_JAVA_OPTIONS - parameters for jvm
SPRING_PROFILES_ACTIVE - profiles used during deployment
EUREKA_CLIENT_SERVICE_URL_DEFAULTZONE - URL of the default eureka load balancer, contains credentials
SPRING_CLOUD_CONFIG_URI - URL of the cloud config server used, contains credentials
JHIPSTER_REGISTRY_PASSWORD - user password for authentication in eureka load balancer
SPRING_DATASOURCE_URL - URL of the postgresql datasource used
JHIPSTER_SLEEP - timeout before microservice deployment
Typical log output for successful deployment:
gateway-app | ----------------------------------------------------------
gateway-app | Application 'gateway' is running! Access URLs:
gateway-app | Local: http://localhost:8085/
gateway-app | External: http://172.25.0.22:8085/
gateway-app | Profile(s): [prod, swagger]
gateway-app | ----------------------------------------------------------
gateway-app | 2020-05-13 07:17:43.131 INFO 1 --- [ main] ru.citeck.ecos.GatewayApp :
gateway-app | ----------------------------------------------------------
gateway-app | Config Server: Connected to the JHipster Registry running in Docker
gateway-app | ----------------------------------------------------------