Skip to content

bscpaz/zuul-server

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zuul Server

This page shows a exeample of how to setup a Zuul Server.

Configuration

As Zuul is deprecated, you cannot choose it anymore from Spring Boot dependencies. So, go to https://start.spring.io/, generate a empty project and add the following dependencies into pom.xml:

<dependency>
  <groupId>org.springframework.boot</groupId>
  <artifactId>spring-boot-starter-web</artifactId>
</dependency>

<dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
</dependency>

<dependency>
  <groupId>org.springframework.cloud</groupId>
  <artifactId>spring-cloud-starter-netflix-zuul</artifactId>
</dependency>

Docker-Compose example

Add this service into a docker-compose.yaml at one level above the "gateway" folder
(...)

  gateway:
    build:
      context: /home/bscpaz/projects/gateway
      dockerfile: Dockerfile
    container_name: gateway
    ports:
      - '8180:8180'
      - '8181:8181'
    environment:
      - ENV_PORT=8181
      - ENV_HOST=gateway
      - EUREKA_SERVER_DEFAULT_ZONE=http://discovery:8761/eureka/
      - EUREKA_INSTANCE_PREFERIPADDRESS=true
      - GATEWAY_ACTIVE_PROFILES=dev
    depends_on:
      - discovery