Discovery service setup + Docker
This commit is contained in:
24
SymphonyDiscovery/Dockerfile
Normal file
24
SymphonyDiscovery/Dockerfile
Normal file
@@ -0,0 +1,24 @@
|
||||
FROM ubuntu:latest
|
||||
LABEL authors="lumijiez"
|
||||
|
||||
FROM maven:3.9.9-eclipse-temurin-21 AS build
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY pom.xml .
|
||||
|
||||
RUN mvn dependency:go-offline
|
||||
|
||||
COPY src /app/src
|
||||
|
||||
RUN mvn clean package -DskipTests
|
||||
|
||||
FROM openjdk:21
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY --from=build /app/target/SymphonyDiscovery-1.0-SNAPSHOT.jar /app/SymphonyDiscovery.jar
|
||||
|
||||
EXPOSE 8081
|
||||
|
||||
ENTRYPOINT ["java", "-jar", "SymphonyDiscovery.jar"]
|
||||
60
SymphonyDiscovery/pom.xml
Normal file
60
SymphonyDiscovery/pom.xml
Normal file
@@ -0,0 +1,60 @@
|
||||
<?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 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>io.github.lumijiez</groupId>
|
||||
<artifactId>SymphonyDiscovery</artifactId>
|
||||
<version>1.0-SNAPSHOT</version>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>com.google.code.gson</groupId>
|
||||
<artifactId>gson</artifactId>
|
||||
<version>2.11.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<configuration>
|
||||
<source>21</source>
|
||||
<target>21</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-shade-plugin</artifactId>
|
||||
<version>3.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<phase>package</phase>
|
||||
<goals>
|
||||
<goal>shade</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.1.0</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestEntries>
|
||||
<Main-Class>io.github.lumijiez.Main</Main-Class>
|
||||
</manifestEntries>
|
||||
</archive>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
||||
@@ -0,0 +1,7 @@
|
||||
package io.github.lumijiez;
|
||||
|
||||
public class Main {
|
||||
public static void main(String[] args) {
|
||||
System.out.print("Discovery service up and running");
|
||||
}
|
||||
}
|
||||
@@ -19,6 +19,16 @@ services:
|
||||
networks:
|
||||
- symphony-network
|
||||
|
||||
symphony-discovery:
|
||||
container_name: discovery
|
||||
build:
|
||||
context: ./SymphonyDiscovery
|
||||
dockerfile: Dockerfile
|
||||
ports:
|
||||
- "8083:8083"
|
||||
networks:
|
||||
- symphony-network
|
||||
|
||||
rabbitmq:
|
||||
image: "rabbitmq:management"
|
||||
container_name: rabbitmq
|
||||
|
||||
Reference in New Issue
Block a user