Skip to content

Commit

Permalink
#7 Start all services using docker-compose.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
vityaman committed Mar 28, 2024
1 parent 7f36d0d commit 89e4326
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 2 deletions.
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
```
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"]
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
18 changes: 17 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,14 +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:
- ./src/main/resources/database:/docker-entrypoint-initdb.d
- ./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

0 comments on commit 89e4326

Please sign in to comment.