Skip to content

Instantly share code, notes, and snippets.

View mstykt's full-sized avatar

Mesut Yakut mstykt

View GitHub Profile
version: '3.9'
services:
order-postgres:
image: postgres:13
container_name: order-postgres
ports:
- "5432:5432"
volumes:
- ./db/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
seller-api-wiremock:
image: wiremock/wiremock
container_name: seller-wiremock
ports:
- "8085:8080"
volumes:
- ./wiremock/seller-api:/home/wiremock
healthcheck:
test: curl --fail -s http://localhost:8085/__admin/ || exit 1
interval: 2s
order-redis:
image: redis:latest
container_name: order-redis
command: redis-server --requirepass redis-pass --appendonly yes
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli","ping"]
interval: 2s
timeout: 3s
order-postgres:
image: postgres:13
container_name: order-postgres
ports:
- "5432:5432"
volumes:
- ./db/docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
environment:
- POSTGRES_USER=order_api
- POSTGRES_PASSWORD=123
order-zookeeper:
image: wurstmeister/zookeeper
container_name: order-zookeeper
ports:
- "2181:2181"
order-kafka:
image: wurstmeister/kafka
container_name: order-kafka
ports:
- "9092:9092"
server:
port: 9090
say-hi:
ribbon:
eureka:
enabled: false
listOfServers: localhost:8080,localhost:8081
ServerListRefreshInterval: 15000
package com.example.ribbon.client;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.2.7.RELEASE</version>
<relativePath/> <!-- lookup parent from repository -->
</parent>
server:
port: ${PORT:8080}
package com.example.demo;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@SpringBootApplication