Docker Compose
This is a README.adoc file. The original repository is located here.
Docker Compose
Branch:
compose
Fenrir ID:compose
Points:50
Task submission
Put all the systemd unit files in the compose directory:
...
├─ compose
│ ├─ migrations
│ ├─ src
│ ├─ ...
│ └─ docker-compose.yml
└─ .git
Task description
You have to create a docker-compose.yml file for this project.
Implement 3 services:
-
server (Kotlin app)
-
database (PostgreSQL)
-
database starter (Python)
Server
Build the source into a jar file (see guides below) and run the server. The server must be available on localhost:12345 once its service has started.
All environment variables are declared in the application.properties file. (See src/main/resources)
Add a health check and a restart policy. The health check endpoint is /actuator.
Find appropriate timings: app failures must be detected under 10 seconds and the startup must complete within 30 seconds.
Guides
How to build Kotlin
To build Kotlin we use maven, a build system which uses pom.xml config files.
Commands:
-
mvn dependency:go-offline -B— download dependencies -
mvn package— build app, the results are placed intarget
Use -DskipTests flag to skip tests
|
Use Java 21 (Kotlin runs on Java Virtual Machine):
-
openjdk21-jre-headless— runtime environment, used to run the binary -
openjdk21-jdk— development kit, used to compile the binary
These are alpine packages.