SMTP setup, Docker + fix ports

This commit is contained in:
2024-11-24 01:59:00 +02:00
parent 339904ac4c
commit 6bee3a0e13
9 changed files with 141 additions and 8 deletions

View File

@@ -19,6 +19,6 @@ WORKDIR /app
COPY --from=build /app/target/SymphonyDatabaseNode-1.0-SNAPSHOT.jar /app/SymphonyDatabaseNode.jar
EXPOSE 8081
EXPOSE 8100
ENTRYPOINT ["java", "-jar", "SymphonyDatabaseNode.jar"]

View File

@@ -50,12 +50,6 @@
<artifactId>log4j-core</artifactId>
<version>2.24.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-layout-template-json</artifactId>
<version>2.24.2</version>
</dependency>
</dependencies>
<build>

View File

@@ -19,6 +19,6 @@ WORKDIR /app
COPY --from=build /app/target/SymphonyDiscovery-1.0-SNAPSHOT.jar /app/SymphonyDiscovery.jar
EXPOSE 8081
EXPOSE 8083
ENTRYPOINT ["java", "-jar", "SymphonyDiscovery.jar"]

24
SymphonySMTP/Dockerfile Normal file
View 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/SymphonySMTP-1.0-SNAPSHOT.jar /app/SymphonySMTP.jar
EXPOSE 8090
ENTRYPOINT ["java", "-jar", "SymphonySMTP.jar"]

77
SymphonySMTP/pom.xml Normal file
View File

@@ -0,0 +1,77 @@
<?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>SymphonySMTP</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>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.32</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
<version>2.24.2</version>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
<version>2.24.2</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>

View File

@@ -0,0 +1,11 @@
package io.github.lumijiez;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
public class Main {
public static void main(String[] args) {
Logger logger = LogManager.getLogger(Main.class);
logger.info("SMTP server started");
}
}

View File

@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN">
<Appenders>
<Console name="Console" target="SYSTEM_OUT">
<PatternLayout>
<Pattern>
%highlight{%d{yyyy-MM-dd HH:mm:ss} %-5level [%t]: %msg}{FATAL=red, ERROR=red, WARN=yellow, INFO=green, DEBUG=blue}%n
</Pattern>
</PatternLayout>
</Console>
</Appenders>
<Loggers>
<Root level="info">
<AppenderRef ref="Console"/>
</Root>
</Loggers>
</Configuration>

View File

@@ -35,6 +35,14 @@ services:
depends_on:
- postgres_db
symphony-smtp:
container_name: smtp
build:
context: ./SymphonySMTP
dockerfile: Dockerfile
ports:
- "8090:8090"
symphony-dbnode1:
container_name: node1
build:

View File

@@ -15,6 +15,7 @@
<module>SymphonyProducer</module>
<module>SymphonyDiscovery</module>
<module>SymphonyDatabaseNode</module>
<module>SymphonySMTP</module>
</modules>
<dependencies>