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