mirror of
https://github.com/BrenBroZAYT/gameyfin.git
synced 2026-06-17 00:30:04 +00:00
Added Dockerfile
Added docker-compose.example.yml Implemented JAR signing with Gradle
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
<configuration default="false" name="Production build" type="GradleRunConfiguration" factoryName="Gradle">
|
<configuration default="false" name="Production build" type="GradleRunConfiguration" factoryName="Gradle">
|
||||||
<ExternalSystemSettings>
|
<ExternalSystemSettings>
|
||||||
<option name="executionName" />
|
<option name="executionName" />
|
||||||
<option name="externalProjectPath" value="$PROJECT_DIR$" />
|
<option name="externalProjectPath" value="$PROJECT_DIR$/app" />
|
||||||
<option name="externalSystemIdString" value="GRADLE" />
|
<option name="externalSystemIdString" value="GRADLE" />
|
||||||
<option name="scriptParameters" value="-Pvaadin.productionMode=true" />
|
<option name="scriptParameters" value="-Pvaadin.productionMode=true" />
|
||||||
<option name="taskDescriptions">
|
<option name="taskDescriptions">
|
||||||
@@ -10,8 +10,8 @@
|
|||||||
</option>
|
</option>
|
||||||
<option name="taskNames">
|
<option name="taskNames">
|
||||||
<list>
|
<list>
|
||||||
<option value=":gameyfin:clean" />
|
<option value="clean" />
|
||||||
<option value=":gameyfin:build" />
|
<option value="build" />
|
||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
<option name="vmOptions" />
|
<option name="vmOptions" />
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
group = "de.grimsi"
|
group = "de.grimsi"
|
||||||
val appMainClass = "org.gameyfin.GameyfinApplicationKt"
|
val appMainClass = "org.gameyfin.app.GameyfinApplicationKt"
|
||||||
|
|
||||||
plugins {
|
plugins {
|
||||||
id("org.springframework.boot")
|
id("org.springframework.boot")
|
||||||
|
|||||||
Binary file not shown.
+14
-9
@@ -1,21 +1,26 @@
|
|||||||
|
# syntax=docker/dockerfile:1.4
|
||||||
FROM eclipse-temurin:21-jre-alpine
|
FROM eclipse-temurin:21-jre-alpine
|
||||||
|
|
||||||
ENV GAMEYFIN_SOURCES=/opt/gameyfin-library
|
|
||||||
ENV USER=gameyfin
|
ENV USER=gameyfin
|
||||||
|
|
||||||
|
|
||||||
RUN addgroup gameyfin && \
|
RUN addgroup gameyfin && \
|
||||||
adduser --disabled-password --gecos "" --ingroup "$USER" --no-create-home "$USER" && \
|
adduser --disabled-password --gecos "" --ingroup "$USER" --no-create-home "$USER"
|
||||||
mkdir -p /opt/gameyfin ${GAMEYFIN_SOURCES} && \
|
|
||||||
chown -R gameyfin:gameyfin /opt/gameyfin ${GAMEYFIN_SOURCES}
|
|
||||||
|
|
||||||
USER gameyfin:gameyfin
|
USER gameyfin:gameyfin
|
||||||
|
|
||||||
ARG JAR_FILE=./backend/target/*.jar
|
|
||||||
COPY ${JAR_FILE} /opt/gameyfin/gameyfin.jar
|
|
||||||
|
|
||||||
WORKDIR /opt/gameyfin
|
WORKDIR /opt/gameyfin
|
||||||
|
|
||||||
|
# Copy application jar (not ending with -plain.jar)
|
||||||
|
COPY --chown=gameyfin:gameyfin ./app/build/libs/ /tmp/app-libs/
|
||||||
|
RUN find /tmp/app-libs -type f -name "*.jar" ! -name "*-plain.jar" -exec cp {} /opt/gameyfin/gameyfin.jar \; && \
|
||||||
|
rm -rf /tmp/app-libs
|
||||||
|
|
||||||
|
# Copy all plugin jars
|
||||||
|
COPY --chown=gameyfin:gameyfin ./plugins/ /tmp/plugins/
|
||||||
|
RUN mkdir -p /opt/gameyfin/plugins && \
|
||||||
|
find /tmp/plugins -type f -path "*/build/libs/*.jar" -exec cp {} /opt/gameyfin/plugins/ \; && \
|
||||||
|
rm -rf /tmp/plugins
|
||||||
|
|
||||||
EXPOSE 8080
|
EXPOSE 8080
|
||||||
|
|
||||||
ENTRYPOINT ["java", "-jar", "gameyfin.jar"]
|
ENTRYPOINT ["java", "-jar", "gameyfin.jar"]
|
||||||
@@ -1,11 +1,18 @@
|
|||||||
version: "3"
|
version: "3"
|
||||||
services:
|
services:
|
||||||
gameyfin:
|
gameyfin:
|
||||||
image: grimsi/gameyfin:v2
|
image: gameyfin/app:2.0.0.beta2
|
||||||
container_name: gameyfin
|
container_name: gameyfin
|
||||||
environment:
|
environment:
|
||||||
PLACEHOLDER: ""
|
# Generate a new APP_KEY using the command `openssl rand -base64 32` or similar.
|
||||||
|
APP_KEY: <you app key here>
|
||||||
volumes:
|
volumes:
|
||||||
- <path to your game library>:/opt/gameyfin-library
|
- "./db:/opt/gameyfin/db"
|
||||||
|
- "./data:/opt/gameyfin/data"
|
||||||
|
- "./logs:/opt/gameyfin/logs"
|
||||||
|
- <mount your library folder(s) here>
|
||||||
ports:
|
ports:
|
||||||
- "8080:8080"
|
- "8080:8080"
|
||||||
|
# If you plan to use the included torrent plugin, uncomment the following lines:
|
||||||
|
# - "6969:6969"
|
||||||
|
# - "6881:6881"
|
||||||
|
|||||||
@@ -1,3 +1,5 @@
|
|||||||
|
# Increase Gradle metaspace size
|
||||||
|
org.gradle.jvmargs=-Xmx2g -XX:MaxMetaspaceSize=512m
|
||||||
# Plugin versions
|
# Plugin versions
|
||||||
kotlinVersion=2.1.21
|
kotlinVersion=2.1.21
|
||||||
kspVersion=2.1.21-2.0.1
|
kspVersion=2.1.21-2.0.1
|
||||||
|
|||||||
@@ -4,6 +4,13 @@ plugins {
|
|||||||
kotlin("jvm")
|
kotlin("jvm")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
val keystorePath: String = rootProject.file("certs/gameyfin.jks").absolutePath
|
||||||
|
val keystoreAlias = "gameyfin-plugins"
|
||||||
|
val keystorePassword: String = (findProperty("keystorePassword") as String?)
|
||||||
|
?: System.getenv("GAMEYFIN_KEYSTORE_PASSWORD")
|
||||||
|
?: ""
|
||||||
|
|
||||||
|
|
||||||
subprojects {
|
subprojects {
|
||||||
apply(plugin = "org.jetbrains.kotlin.jvm")
|
apply(plugin = "org.jetbrains.kotlin.jvm")
|
||||||
|
|
||||||
@@ -56,4 +63,30 @@ subprojects {
|
|||||||
tasks.build {
|
tasks.build {
|
||||||
dependsOn("copyDependencyClasses")
|
dependsOn("copyDependencyClasses")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
tasks.register<Exec>("signJar") {
|
||||||
|
dependsOn(tasks.jar)
|
||||||
|
val jarFile = tasks.jar.get().archiveFile.get().asFile
|
||||||
|
|
||||||
|
// Only enable if password is present
|
||||||
|
enabled = keystorePassword.isNotEmpty()
|
||||||
|
|
||||||
|
commandLine(
|
||||||
|
"jarsigner",
|
||||||
|
"-keystore", keystorePath,
|
||||||
|
"-storepass", keystorePassword,
|
||||||
|
jarFile.absolutePath,
|
||||||
|
keystoreAlias
|
||||||
|
)
|
||||||
|
doFirst {
|
||||||
|
if (keystorePassword.isEmpty()) {
|
||||||
|
logger.lifecycle("Keystore password not provided, skipping JAR signing.")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
tasks.build {
|
||||||
|
dependsOn("signJar")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user