Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.git
.github
.gradle
**/build
**/out
**/target
.idea
.vscode
**/*.iml
**/*.ipr
**/*.iws
**/.DS_Store
29 changes: 29 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM amazoncorretto:21-alpine AS builder

WORKDIR /app

COPY . .

RUN ./gradlew clean :infrastructure:bootJar --no-daemon

FROM amazoncorretto:21-alpine

WORKDIR /app

RUN mkdir -p /app/storage && chmod -R 777 /app/storage

COPY --from=builder /app/build/libs/application.jar app.jar

ENV SPRING_PROFILES_ACTIVE=local
ENV KEYCLOAK_REALM=callv2
ENV KEYCLOAK_HOST=http://localhost:8090
ENV POSTGRES_HOST=localhost
ENV POSTGRES_PORT=5432
ENV POSTGRES_DATABASE=callv2
ENV POSTGRES_USERNAME=callv2
ENV POSTGRES_PASSWORD=callv2
ENV STORAGE_LOCATION=/app/storage

EXPOSE 8080

ENTRYPOINT ["sh", "-c", "java -jar /app/app.jar --spring.profiles.active=${SPRING_PROFILES_ACTIVE}"]
6 changes: 5 additions & 1 deletion infrastructure/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ plugins {
}

group = 'com.callv2'
version = '1.0-SNAPSHOT'

bootJar {
archiveFileName = 'application.jar'
destinationDirectory = file("${rootProject.buildDir}/libs")
}

repositories {
mavenCentral()
Expand Down
14 changes: 14 additions & 0 deletions infrastructure/src/main/resources/application-hmg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
keycloak:
realm: ${KEYCLOAK_REALM}
host: ${KEYCLOAK_HOST}

postgres:
host: ${POSTGRES_HOST}
port: ${POSTGRES_PORT}
database: ${POSTGRES_DATABASE}
username: ${POSTGRES_USERNAME}
password: ${POSTGRES_PASSWORD}

storage:
file-system:
location: ${STORAGE_LOCATION}
4 changes: 0 additions & 4 deletions infrastructure/src/main/resources/application-local.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
keycloak:
realm: callv2
host: http://localhost:8090
client:
user-api:
client-id: user-api
client-secret: local-client-secret

postgres:
host: localhost
Expand Down