diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 00000000..72c13540 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,11 @@ +FROM openjdk:17-jdk-bullseye as builder +WORKDIR /app +COPY gradle /app/gradle +COPY src /app/src +COPY gradlew build.gradle settings.gradle /app +RUN ./gradlew build + +FROM openjdk:17-alpine as dist +COPY --from=builder /app/build/libs/aiode-1.0-SNAPSHOT.jar /app.jar +COPY versions.xml / +CMD java -jar /app.jar diff --git a/build.gradle b/build.gradle index 4c19206a..ffe1a040 100644 --- a/build.gradle +++ b/build.gradle @@ -87,6 +87,22 @@ description = "aiode" sourceCompatibility = "17" targetCompatibility = "17" +task fatJar(type: Jar) { + manifest.from jar.manifest + classifier = 'all' + duplicatesStrategy = DuplicatesStrategy.EXCLUDE + from { + configurations.runtimeClasspath.collect { + it.isDirectory() ? it : zipTree(it) + } + } { + exclude "META-INF/*.SF" + exclude "META-INF/*.DSA" + exclude "META-INF/*.RSA" + } + with jar +} + jar { manifest { attributes( diff --git a/docker-compose.yml b/docker-compose.yml new file mode 100644 index 00000000..256614dd --- /dev/null +++ b/docker-compose.yml @@ -0,0 +1,32 @@ +# Use postgres/example user/password credentials +version: '3.1' + +services: + + postgres: + image: postgres + restart: always + environment: + POSTGRES_PASSWORD: aiodedbpassword + POSTGRES_DB: aiode + PGDATA: /var/lib/postgresql/data/pgdata + volumes: + - aiode_postgres:/var/lib/postgresql/data + + bot: + image: :latest + restart: always + depends_on: + - postgres + environment: + POSTGRES_PASSWORD: aiodedbpassword + POSTGRES_USERNAME: postgres + ADMIN_USERS: "" + YOUTUBE_CREDENTIALS: "" + SPOTIFY_CLIENT_ID: "" + SPOTIFY_CLIENT_SECRET: "" + DISCORD_TOKEN: "" + POSTGRES_JDBC_URI: jdbc:postgresql://postgres:5432/aiode + ports: + - 8000:8000 + - 8080:8080