Compare commits
4 commits
18ab41ed09
...
1a7cb6f055
Author | SHA1 | Date | |
---|---|---|---|
1a7cb6f055 | |||
9de90700c3 | |||
9dc9f16c06 | |||
9754e36c99 |
4 changed files with 4 additions and 4 deletions
|
@ -16,7 +16,7 @@ COPY ./ui .
|
|||
RUN npm run build-only
|
||||
|
||||
# Stage 3: Create the jlink app
|
||||
FROM docker.io/eclipse-temurin:20-jdk-alpine
|
||||
FROM docker.io/eclipse-temurin:19-jdk-alpine
|
||||
WORKDIR /app
|
||||
COPY --from=maven /app/target/dchat-*-fat.jar /app/dchat.jar
|
||||
COPY --from=vuejs /app/dist /app/ui/dist
|
||||
|
|
|
@ -14,6 +14,7 @@ services:
|
|||
- POSTGRES_PASSWORD=<postgres-password>
|
||||
- POSTGRES_URL=jdbc:postgresql://db:5432/dchat
|
||||
- API_PORT=8080
|
||||
- JDK_JAVA_OPTIONS="--enable-preview"
|
||||
db:
|
||||
image: docker.io/postgres:15-alpine
|
||||
restart: unless-stopped
|
||||
|
|
|
@ -36,7 +36,7 @@ public class DiscordBot implements Runnable {
|
|||
.setToken(discordApiKey)
|
||||
.login()
|
||||
.join();
|
||||
Runtime.getRuntime().addShutdownHook(new Thread(() -> {
|
||||
Runtime.getRuntime().addShutdownHook(Thread.ofVirtual().unstarted(() -> {
|
||||
logger.info("Shutting down Discord application");
|
||||
discordApi.disconnect();
|
||||
}));
|
||||
|
|
|
@ -60,8 +60,7 @@ public class Main {
|
|||
public void run() {
|
||||
logger.info("Starting services...");
|
||||
try (var executor = Executors.newFixedThreadPool(2)) {
|
||||
var migrationResult = executor.submit(dbMigrator);
|
||||
migrationResult.get();
|
||||
executor.submit(dbMigrator).get(); // Waiting for migrations
|
||||
executor.submit(discordBot);
|
||||
executor.submit(webAPI);
|
||||
} catch (ExecutionException | InterruptedException e) {
|
||||
|
|
Loading…
Reference in a new issue