Merge pull request #4 from gotson/docker-simplified

Docker simplified
This commit is contained in:
Gauthier 2019-08-27 21:45:37 +08:00 committed by GitHub
commit a745d3970e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 6 deletions

View file

@ -70,7 +70,7 @@ Each configuration key can have a different format depending if it's from the en
### Mandatory configuration
In order to make Komga run, you need to specify some mandatory configuration keys:
In order to make Komga run, you need to specify some mandatory configuration keys (unless you use Docker, in which case defaults are setup):
- `SPRING_PROFILES_ACTIVE` / `spring.profiles.active`: `prod` - this will enable the database management and upgrades for new versions.
- `SPRING_DATASOURCE_URL` / `spring.datasource.url`: the path of the database file. For Docker I use `jdbc:h2:/config/database.h2;DB_CLOSE_DELAY=-1`, where `/config/database.h2` is the actual file inside the docker container. You can customize this part if running without docker.

View file

@ -11,10 +11,6 @@ services:
ports:
- 8090:8080
environment:
- SPRING_PROFILES_ACTIVE=prod
- SPRING_DATASOURCE_URL=jdbc:h2:/config/database.h2;DB_CLOSE_DELAY=-1
- KOMGA_ROOT_FOLDER=/books
- KOMGA_ROOT_FOLDER_SCAN_CRON=0 0 * * * ? # periodic scan every hour
- KOMGA_USER_PASSWORD=your-admin-password
- KOMGA_ADMIN_PASSWORD=your-user-password
restart: unless-stopped

View file

@ -4,4 +4,5 @@ ARG DEPENDENCY=target/dependency
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY}/META-INF /app/META-INF
COPY ${DEPENDENCY}/BOOT-INF/classes /app
ENV SPRING_PROFILES_ACTIVE=docker
ENTRYPOINT ["java","-cp","app:app/lib/*","org.gotson.komga.ApplicationKt"]

View file

@ -105,7 +105,10 @@ tasks {
}
configure<DockerExtension> {
name = "gotson/komga:latest"
name = "gotson/komga"
tag("latest", "$name:latest")
tag("semVer", "$name:$version")
tag("beta", "$name:beta")
copySpec.from(tasks.getByName("unpack").outputs).into("dependency")
buildArgs(mapOf("DEPENDENCY" to "dependency"))
dependsOn(tasks.getByName("clean"), tasks.getByName("test"))

View file

@ -0,0 +1,8 @@
spring:
profiles:
include: prod
datasource:
url: jdbc:h2:/config/database.h2;DB_CLOSE_DELAY=-1
komga:
root-folder: /books
root-folder-scan-cron: "0 */15 * * * ?"