mirror of https://github.com/hykilpikonna/AquaDX
parent
d4178c85a9
commit
0c93b85024
|
@ -1,6 +1,6 @@
|
||||||
# Use a multi-stage build to keep the image size small
|
# Use a multi-stage build to keep the image size small
|
||||||
# Start with a Gradle image for building the project
|
# Start with a Gradle image for building the project
|
||||||
FROM gradle:jdk11 as builder
|
FROM gradle:jdk21-alpine as builder
|
||||||
|
|
||||||
# Copy the Gradle wrapper and configuration files separately to leverage Docker cache
|
# Copy the Gradle wrapper and configuration files separately to leverage Docker cache
|
||||||
COPY --chown=gradle:gradle gradlew /home/gradle/
|
COPY --chown=gradle:gradle gradlew /home/gradle/
|
||||||
|
@ -20,13 +20,13 @@ COPY --chown=gradle:gradle src /home/gradle/src
|
||||||
RUN ./gradlew build -x test
|
RUN ./gradlew build -x test
|
||||||
|
|
||||||
# Start with a fresh image for the runtime
|
# Start with a fresh image for the runtime
|
||||||
FROM openjdk:11-jre-slim
|
FROM eclipse-temurin:21-jre-alpine
|
||||||
|
|
||||||
# Set the deployment directory
|
# Set the deployment directory
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Copy only the built JAR from the builder image
|
# Copy only the built JAR from the builder image
|
||||||
COPY --from=builder /home/gradle/build/libs/aqua-?.?.??.jar /app/
|
COPY --from=builder /home/gradle/build/libs/AquaDX-*.jar /app/
|
||||||
|
|
||||||
# The command to run the application
|
# The command to run the application
|
||||||
CMD java -jar aqua-*.jar
|
CMD java -jar AquaDX-*.jar
|
||||||
|
|
|
@ -97,7 +97,7 @@ dependencies {
|
||||||
group = "icu.samnya"
|
group = "icu.samnya"
|
||||||
version = "1.0.0"
|
version = "1.0.0"
|
||||||
description = "AquaDX Arcade Server"
|
description = "AquaDX Arcade Server"
|
||||||
java.sourceCompatibility = JavaVersion.VERSION_17
|
java.sourceCompatibility = JavaVersion.VERSION_21
|
||||||
|
|
||||||
springBoot {
|
springBoot {
|
||||||
mainClass.set("icu.samnyan.aqua.EntryKt")
|
mainClass.set("icu.samnyan.aqua.EntryKt")
|
||||||
|
|
|
@ -4,23 +4,31 @@ services:
|
||||||
app:
|
app:
|
||||||
build: .
|
build: .
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080" # Replace with your application's port
|
- "80:80"
|
||||||
|
- "8443:8443"
|
||||||
|
- "22345:22345"
|
||||||
environment:
|
environment:
|
||||||
- DB_HOST=db
|
- SPRING_DATASOURCE_URL=jdbc:mariadb://db:3306/main
|
||||||
- DB_PORT=3306
|
- SPRING_DATASOURCE_USERNAME=cat
|
||||||
- DB_USER=root
|
- SPRING_DATASOURCE_PASSWORD=meow
|
||||||
- DB_PASSWORD=mysecret
|
- SPRING_DATASOURCE_DRIVER_CLASS_NAME=org.mariadb.jdbc.Driver
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
|
volumes:
|
||||||
|
- ./config:/app/config
|
||||||
|
- ./data:/app/data
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: mariadb:latest
|
image: mariadb:latest
|
||||||
environment:
|
environment:
|
||||||
MYSQL_ROOT_PASSWORD: mysecret
|
MYSQL_ROOT_PASSWORD: meow
|
||||||
MYSQL_DATABASE: myappdb
|
MYSQL_DATABASE: main
|
||||||
MYSQL_USER: myappuser
|
MYSQL_USER: cat
|
||||||
MYSQL_PASSWORD: myapppassword
|
MYSQL_PASSWORD: meow
|
||||||
ports:
|
ports:
|
||||||
- "3306:3306"
|
- "127.0.0.1:3369:3306"
|
||||||
volumes:
|
# There is an unfixed bug in Windows WSL2 that prevents volumes from working
|
||||||
- ./db:/var/lib/mysql
|
# properly with mariadb. Please uncomment this on Linux / MacOS.
|
||||||
|
# Check https://stackoverflow.com/questions/76711550/i-get-an-error-on-mariadb-allways-i-start-my-app
|
||||||
|
# volumes:
|
||||||
|
# - ./data/db:/var/lib/mysql
|
||||||
|
|
Loading…
Reference in New Issue