Skip to content
Snippets Groups Projects
Commit bd2ca65f authored by Martin Weise's avatar Martin Weise
Browse files

Refs #6

- Add colorful output depending on log severity :tada:
- Improved Dockerfile to use Docker caching better (=as long as pom.xml does not change, doesn't download deps again)
- Surpress bulky Spring INFO output
- Fix useless "No URLs will be polled" warning through suggested empty config.properties (https://github.com/Netflix/Hystrix/issues/275)
- Finally replaced Spring Web MVC with Webflux
- CORS Config replacing old Web MVC Config (fixes warning in f622eb3d)
parent f622eb3d
No related branches found
No related tags found
No related merge requests found
Showing
with 63 additions and 62 deletions
...@@ -7,11 +7,9 @@ services: ...@@ -7,11 +7,9 @@ services:
hostname: fda-discovery-server hostname: fda-discovery-server
build: ./fda-discovery-server build: ./fda-discovery-server
image: fda-discovery-server image: fda-discovery-server
environment: #environment:
SPRING_PROFILES_ACTIVE: docker # SPRING_PROFILES_ACTIVE: docker
network_mode: bridge network_mode: bridge
expose:
- 9090
ports: ports:
- 9090:9090 - 9090:9090
...@@ -21,10 +19,8 @@ services: ...@@ -21,10 +19,8 @@ services:
build: ./fda-gateway-service build: ./fda-gateway-service
image: fda-gateway-service image: fda-gateway-service
network_mode: bridge network_mode: bridge
environment: #environment:
SPRING_PROFILES_ACTIVE: docker # SPRING_PROFILES_ACTIVE: docker
expose:
- 9095
ports: ports:
- 9095:9095 - 9095:9095
links: links:
...@@ -49,10 +45,8 @@ services: ...@@ -49,10 +45,8 @@ services:
context: ./fda-database-managing-service context: ./fda-database-managing-service
image: fda-database-managing-service image: fda-database-managing-service
network_mode: bridge network_mode: bridge
environment: #environment:
SPRING_PROFILES_ACTIVE: docker # SPRING_PROFILES_ACTIVE: docker
expose:
- 9092
ports: ports:
- 9092:9092 - 9092:9092
links: links:
...@@ -70,10 +64,8 @@ services: ...@@ -70,10 +64,8 @@ services:
build: ./fda-container-managing-service build: ./fda-container-managing-service
image: fda-container-managing-service image: fda-container-managing-service
network_mode: bridge network_mode: bridge
environment: #environment:
SPRING_PROFILES_ACTIVE: docker # SPRING_PROFILES_ACTIVE: docker
expose:
- 9091
ports: ports:
- 9091:9091 - 9091:9091
volumes: volumes:
...@@ -91,10 +83,8 @@ services: ...@@ -91,10 +83,8 @@ services:
build: ./fda-query-service build: ./fda-query-service
image: fda-query-service image: fda-query-service
network_mode: bridge network_mode: bridge
environment: #environment:
SPRING_PROFILES_ACTIVE: docker # SPRING_PROFILES_ACTIVE: docker
expose:
- 9093
ports: ports:
- 9093:9093 - 9093:9093
volumes: volumes:
...@@ -115,10 +105,8 @@ services: ...@@ -115,10 +105,8 @@ services:
image: fda-table-service image: fda-table-service
network_mode: bridge network_mode: bridge
environment: environment:
SPRING_PROFILES_ACTIVE: docker # SPRING_PROFILES_ACTIVE: docker
multipart.location: /tmp multipart.location: /tmp
expose:
- 9094
ports: ports:
- 9094:9094 - 9094:9094
volumes: volumes:
...@@ -138,13 +126,11 @@ services: ...@@ -138,13 +126,11 @@ services:
network_mode: bridge network_mode: bridge
command: sh -c "/wait && flask run" command: sh -c "/wait && flask run"
environment: environment:
- EUREKA_SERVER=http://fda-discovery-server:9090/eureka EUREKA_SERVER: http://fda-discovery-server:9090/eureka
- WAIT_HOSTS=fda-discovery-server:9090 WAIT_HOSTS: fda-discovery-server:9090
- WAIT_HOSTS_TIMEOUT=300 WAIT_HOSTS_TIMEOUT: 300
- WAIT_SLEEP_INTERVAL=30 WAIT_SLEEP_INTERVAL: 30
- WAIT_HOST_CONNECT_TIMEOUT=30 WAIT_HOST_CONNECT_TIMEOUT: 30
expose:
- 5000
ports: ports:
- 5000:5000 - 5000:5000
volumes: volumes:
...@@ -161,8 +147,6 @@ services: ...@@ -161,8 +147,6 @@ services:
hostname: fda-ui hostname: fda-ui
build: ./fda-ui build: ./fda-ui
image: fda-ui image: fda-ui
expose:
- 3000
ports: ports:
- 3000:3000 - 3000:3000
links: links:
......
...@@ -2,13 +2,14 @@ ...@@ -2,13 +2,14 @@
FROM maven:slim as build FROM maven:slim as build
MAINTAINER Martin Weise <martin.weise@tuwien.ac.at> MAINTAINER Martin Weise <martin.weise@tuwien.ac.at>
COPY ./api ./api
COPY ./rest-service ./rest-service
COPY ./services ./services
COPY ./pom.xml ./ COPY ./pom.xml ./
RUN mvn -fn -B dependency:go-offline > /dev/null RUN mvn -fn -B dependency:go-offline > /dev/null
COPY ./api ./api
COPY ./rest-service ./rest-service
COPY ./services ./services
RUN mvn -q clean package > /dev/null RUN mvn -q clean package > /dev/null
###### SECOND STAGE ###### ###### SECOND STAGE ######
......
...@@ -3,6 +3,7 @@ spring.application.name=fda-container-managing ...@@ -3,6 +3,7 @@ spring.application.name=fda-container-managing
spring.main.banner-mode=off spring.main.banner-mode=off
logging.level.root=warn logging.level.root=warn
logging.level.at.=info logging.level.at.=info
eureka.instance.hostname=fda-container-managing logging.pattern.console="%d %highlight(%-5level): %msg%n"
eureka.client.serviceUrl.defaultZone=http://fda-discovery-server:9090/eureka/ eureka.instance.hostname=fda-discovery-server
eureka.client.serviceUrl.defaultZone=http://${eureka.instance.hostname}:${server.port}/eureka/
eureka.instance.preferIpAddress=true eureka.instance.preferIpAddress=true
\ No newline at end of file
# https://github.com/Netflix/Hystrix/issues/275
\ No newline at end of file
...@@ -2,13 +2,14 @@ ...@@ -2,13 +2,14 @@
FROM maven:slim as build FROM maven:slim as build
MAINTAINER Martin Weise <martin.weise@tuwien.ac.at> MAINTAINER Martin Weise <martin.weise@tuwien.ac.at>
COPY ./pom.xml ./
RUN mvn -fn -B dependency:go-offline > /dev/null
COPY ./api ./api COPY ./api ./api
COPY ./gateways ./gateways COPY ./gateways ./gateways
COPY ./rest-service ./rest-service COPY ./rest-service ./rest-service
COPY ./services ./services COPY ./services ./services
COPY ./pom.xml ./
RUN mvn -fn -B dependency:go-offline > /dev/null
RUN mvn -q clean package > /dev/null RUN mvn -q clean package > /dev/null
......
...@@ -3,6 +3,7 @@ spring.application.name=fda-database-managing ...@@ -3,6 +3,7 @@ spring.application.name=fda-database-managing
spring.main.banner-mode=off spring.main.banner-mode=off
logging.level.root=warn logging.level.root=warn
logging.level.at.=info logging.level.at.=info
eureka.instance.hostname=fda-database-managing logging.pattern.console="%d %highlight(%-5level): %msg%n"
eureka.client.serviceUrl.defaultZone=http://fda-discovery-server:9090/eureka/ eureka.instance.hostname=fda-discovery-server
eureka.client.serviceUrl.defaultZone=http://${eureka.instance.hostname}:${server.port}/eureka/
eureka.instance.preferIpAddress=true eureka.instance.preferIpAddress=true
\ No newline at end of file
# https://github.com/Netflix/Hystrix/issues/275
\ No newline at end of file
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
FROM maven:slim as build FROM maven:slim as build
MAINTAINER Martin Weise <martin.weise@tuwien.ac.at> MAINTAINER Martin Weise <martin.weise@tuwien.ac.at>
COPY ./src ./src
COPY ./pom.xml ./ COPY ./pom.xml ./
RUN mvn -fn -B dependency:go-offline > /dev/null RUN mvn -fn -B dependency:go-offline > /dev/null
COPY ./src ./src
RUN mvn -q clean package > /dev/null RUN mvn -q clean package > /dev/null
###### SECOND STAGE ###### ###### SECOND STAGE ######
......
...@@ -3,8 +3,9 @@ spring.application.name=fda-discovery-server ...@@ -3,8 +3,9 @@ spring.application.name=fda-discovery-server
spring.main.banner-mode=off spring.main.banner-mode=off
logging.level.root=warn logging.level.root=warn
logging.level.at.=info logging.level.at.=info
logging.pattern.console="%d %highlight(%-5level): %msg%n"
eureka.client.register-with-eureka=false eureka.client.register-with-eureka=false
eureka.client.fetch-registry=false eureka.client.fetch-registry=false
eureka.instance.hostname=fda-discovery-server eureka.instance.hostname=fda-discovery-server
eureka.client.serviceUrl.defaultZone=http://fda-discovery-server:9090/eureka/ eureka.client.serviceUrl.defaultZone=http://${eureka.instance.hostname}:${server.port}/eureka/
eureka.instance.preferIpAddress=true eureka.instance.preferIpAddress=true
\ No newline at end of file
# https://github.com/Netflix/Hystrix/issues/275
\ No newline at end of file
...@@ -2,11 +2,12 @@ ...@@ -2,11 +2,12 @@
FROM maven:slim as build FROM maven:slim as build
MAINTAINER Martin Weise <martin.weise@tuwien.ac.at> MAINTAINER Martin Weise <martin.weise@tuwien.ac.at>
COPY ./src ./src
COPY ./pom.xml ./ COPY ./pom.xml ./
RUN mvn -fn -B dependency:go-offline > /dev/null RUN mvn -fn -B dependency:go-offline > /dev/null
COPY ./src ./src
RUN mvn -q clean package > /dev/null RUN mvn -q clean package > /dev/null
###### SECOND STAGE ###### ###### SECOND STAGE ######
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.boot</groupId> <groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId> <artifactId>spring-boot-starter-webflux</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.springframework.cloud</groupId> <groupId>org.springframework.cloud</groupId>
......
package at.tuwien.gatewayservice.config; package at.tuwien.gatewayservice.config;
import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.CorsRegistry; import org.springframework.web.reactive.config.CorsRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.reactive.config.WebFluxConfigurer;
@Configuration @Configuration
public class WebConfig implements WebMvcConfigurer { public class WebConfig implements WebFluxConfigurer {
@Override @Override
public void addCorsMappings(CorsRegistry registry) { public void addCorsMappings(CorsRegistry registry) {
registry.addMapping("/**").allowedOrigins("*"); registry.addMapping("/**")
.allowedOrigins("*"); // FIXME
} }
} }
...@@ -4,5 +4,5 @@ spring.main.banner-mode=off ...@@ -4,5 +4,5 @@ spring.main.banner-mode=off
logging.level.root=warn logging.level.root=warn
logging.level.at.=info logging.level.at.=info
logging.pattern.console="%d %highlight(%-5level): %msg%n" logging.pattern.console="%d %highlight(%-5level): %msg%n"
eureka.instance.hostname=fda-gateway-service eureka.instance.hostname=fda-discovery-server
eureka.client.serviceUrl.defaultZone=http://fda-discovery-server:9090/eureka/ eureka.client.serviceUrl.defaultZone=http://${eureka.instance.hostname}:${server.port}/eureka/
\ No newline at end of file \ No newline at end of file
# https://github.com/Netflix/Hystrix/issues/275
\ No newline at end of file
...@@ -2,14 +2,15 @@ ...@@ -2,14 +2,15 @@
FROM maven:slim as build FROM maven:slim as build
MAINTAINER Martin Weise <martin.weise@tuwien.ac.at> MAINTAINER Martin Weise <martin.weise@tuwien.ac.at>
COPY ./pom.xml ./
RUN mvn -fn -B dependency:go-offline > /dev/null
COPY ./api ./api COPY ./api ./api
COPY ./gateways ./gateways COPY ./gateways ./gateways
COPY ./persistence ./persistence COPY ./persistence ./persistence
COPY ./rest-service ./rest-service COPY ./rest-service ./rest-service
COPY ./services ./services COPY ./services ./services
COPY ./pom.xml ./
RUN mvn -fn -B dependency:go-offline > /dev/null
RUN mvn -q clean package > /dev/null RUN mvn -q clean package > /dev/null
......
...@@ -3,5 +3,6 @@ spring.application.name=fda-query-service ...@@ -3,5 +3,6 @@ spring.application.name=fda-query-service
spring.main.banner-mode=off spring.main.banner-mode=off
logging.level.root=warn logging.level.root=warn
logging.level.at.=info logging.level.at.=info
eureka.instance.hostname=fda-query-service logging.pattern.console="%d %highlight(%-5level): %msg%n"
eureka.client.serviceUrl.defaultZone=http://fda-discovery-server:9090/eureka/ eureka.instance.hostname=fda-discovery-server
eureka.client.serviceUrl.defaultZone=http://${eureka.instance.hostname}:${server.port}/eureka/
# https://github.com/Netflix/Hystrix/issues/275
\ No newline at end of file
...@@ -2,13 +2,14 @@ ...@@ -2,13 +2,14 @@
FROM maven:slim as build FROM maven:slim as build
MAINTAINER Martin Weise <martin.weise@tuwien.ac.at> MAINTAINER Martin Weise <martin.weise@tuwien.ac.at>
COPY ./pom.xml ./
RUN mvn -fn -B dependency:go-offline > /dev/null
COPY ./api ./api COPY ./api ./api
COPY ./gateways ./gateways COPY ./gateways ./gateways
COPY ./rest-service ./rest-service COPY ./rest-service ./rest-service
COPY ./services ./services COPY ./services ./services
COPY ./pom.xml ./
RUN mvn -fn -B dependency:go-offline > /dev/null
RUN mvn -q clean package > /dev/null RUN mvn -q clean package > /dev/null
......
...@@ -3,8 +3,9 @@ spring.application.name=fda-table-service ...@@ -3,8 +3,9 @@ spring.application.name=fda-table-service
spring.main.banner-mode=off spring.main.banner-mode=off
logging.level.root=warn logging.level.root=warn
logging.level.at.=info logging.level.at.=info
eureka.instance.hostname=fda-table-service logging.pattern.console="%d %highlight(%-5level): %msg%n"
eureka.client.serviceUrl.defaultZone=http://fda-discovery-server:9090/eureka/ eureka.instance.hostname=fda-discovery-server
eureka.client.serviceUrl.defaultZone=http://${eureka.instance.hostname}:${server.port}/eureka/
spring.servlet.multipart.max-file-size=50MB spring.servlet.multipart.max-file-size=50MB
spring.servlet.multipart.max-request-size=50MB spring.servlet.multipart.max-request-size=50MB
multipart.location=${java.io.tmpdir} multipart.location=${java.io.tmpdir}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment