Skip to content

Commit

Permalink
#7 Dockerized botalka service (#23)
Browse files Browse the repository at this point in the history
  • Loading branch information
vityaman authored Mar 28, 2024
1 parent 28ea466 commit 9f34821
Show file tree
Hide file tree
Showing 16 changed files with 111 additions and 93 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@ jobs:
uses: gradle/actions/setup-gradle@v3

- name: Build Gateway
run: (cd botalka && ./gradlew :build)
run: (./gradlew :botalka:build)
40 changes: 40 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,44 @@
hs_err_pid*
replay_pid*

### IntelliJ IDEA ###
.idea
*.iws
*.iml
*.ipr
out/
!**/src/main/**/out/
!**/src/test/**/out/

### NetBeans ###
/nbproject/private/
/nbbuild/
/dist/
/nbdist/
/.nb-gradle/

### VS Code ###
.vscode/

### Kotlin ###
.kotlin

### STS ###
.apt_generated
.classpath
.factorypath
.project
.settings
.springBeans
.sts4-cache
bin/
!**/src/main/**/bin/
!**/src/test/**/bin/

# Other
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
!**/src/main/**/build/
!**/src/test/**/build/
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
# Learning Management System

A simple learning management system.

## Build & Run

```bash
gradle :botalka:build
docker compose down
docker compose up --build --force-recreate
```
40 changes: 0 additions & 40 deletions botalka/.gitignore

This file was deleted.

5 changes: 5 additions & 0 deletions botalka/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM eclipse-temurin:21-jdk-alpine

COPY build/libs/botalka-0.0.1.jar /botalka.jar

ENTRYPOINT ["java", "-jar", "/botalka.jar"]
5 changes: 2 additions & 3 deletions botalka/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ tasks.runKtlintCheckOverMainSourceSet {
detekt {
buildUponDefaultConfig = true
allRules = false
config.setFrom(file("$projectDir/../config/detekt.yml"))
config.setFrom(file("$rootDir/config/detekt.yml"))
}

tasks.withType<Detekt>().configureEach {
Expand Down Expand Up @@ -194,9 +194,8 @@ koverReport {
}

jooq {
val schemaSql = "src/main/resources/database/schema.sql"
val schemaSql = "$projectDir/src/main/resources/database/schema.sql"

version = jooqVersion
executions {
create("main") {
configuration {
Expand Down
14 changes: 0 additions & 14 deletions botalka/docker-compose.yml

This file was deleted.

23 changes: 0 additions & 23 deletions botalka/gradle/wrapper/gradle-wrapper.properties

This file was deleted.

1 change: 0 additions & 1 deletion botalka/settings.gradle.kts

This file was deleted.

2 changes: 1 addition & 1 deletion botalka/src/main/resources/application.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ spring:
application:
name: botalka
r2dbc:
url: r2dbc:postgresql://localhost:5432/postgres
url: r2dbc:postgresql://database:5432/postgres
username: postgres
password: postgres
server:
Expand Down
30 changes: 30 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
version: '3.8'
services:
botalka:
container_name: lms-botalka
build:
context: botalka
dockerfile: Dockerfile
image: botalka:latest
ports:
- "8080:8080"
networks:
- lms-network
database:
container_name: lms-database
image: postgres
restart: always
ports:
- "5432:5432"
volumes:
- ./botalka/src/main/resources/database:/docker-entrypoint-initdb.d
environment:
POSTGRES_DB: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
networks:
- lms-network
networks:
lms-network:
driver: bridge

File renamed without changes.
7 changes: 7 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
File renamed without changes.
20 changes: 10 additions & 10 deletions botalka/gradlew.bat → gradlew.bat
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,11 @@ set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if %ERRORLEVEL% equ 0 goto execute

echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH. 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand All @@ -57,11 +57,11 @@ set JAVA_EXE=%JAVA_HOME%/bin/java.exe

if exist "%JAVA_EXE%" goto execute

echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
echo. 1>&2
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME% 1>&2
echo. 1>&2
echo Please set the JAVA_HOME variable in your environment to match the 1>&2
echo location of your Java installation. 1>&2

goto fail

Expand Down
7 changes: 7 additions & 0 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "0.7.0"
}

rootProject.name = "lms"

include("botalka")

0 comments on commit 9f34821

Please sign in to comment.