Skip to content

Commit

Permalink
Add docker-compose.yml and change to installDist
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziedelth committed Dec 22, 2023
1 parent 25b66a8 commit 5ab361b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/global_workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ name: Global workflow
on:
pull_request:
push:
branches:
- master

jobs:
test:
Expand Down
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM gradle:8.5.0-jdk21-jammy AS build
COPY --chown=gradle:gradle . /app
WORKDIR /app
RUN gradle build --no-daemon -x test
RUN gradle clean installDist

FROM mcr.microsoft.com/playwright:v1.40.1-jammy
ARG version=21.0.1.12-1
Expand All @@ -21,7 +21,7 @@ RUN set -eux; apt-get update && apt-get install -y --no-install-recommends \
&& rm -rf /var/lib/apt/lists/* /var/cache/apt/archives/*

# Copy app from build stage
COPY --from=build /app/build/libs/core-all.jar /app/core.jar
COPY --from=build /app/build/install/core /app
COPY --from=build /app/hibernate.cfg.xml /app/hibernate.cfg.xml

# Configure timezone and install necessary packages
Expand All @@ -33,4 +33,4 @@ RUN apt-get update && \

WORKDIR /app
EXPOSE 37100
CMD ["java", "-jar", "core.jar"]
CMD ["./bin/core"]
4 changes: 4 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ dependencies {
testImplementation("com.h2database:h2:2.2.224")
}

kotlin {
jvmToolchain(21)
}

tasks.jacocoTestReport {
reports {
xml.required = true
Expand Down
25 changes: 25 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
version: '3.8'
services:
shikkanime-db:
image: postgres:16-alpine
restart: always
container_name: shikkanime-db
environment:
POSTGRES_PASSWORD: "mysecretpassword"
POSTGRES_USER: postgres
POSTGRES_DB: shikkanime
healthcheck:
test: [ "CMD", "pg_isready", "-U", "postgres" ]
shikkanime-core:
image: shikkanime-core:latest
ports:
- "37100:37100"
restart: on-failure
container_name: shikkanime-core
depends_on:
shikkanime-db:
condition: service_healthy
environment:
DATABASE_URL: jdbc:postgresql://shikkanime-db:5432/shikkanime
DATABASE_USERNAME: postgres
DATABASE_PASSWORD: "mysecretpassword"

0 comments on commit 5ab361b

Please sign in to comment.