Skip to content

Commit

Permalink
1.1.18 (#2)
Browse files Browse the repository at this point in the history
docker-compose.yml added
Kora up
README.md updated
  • Loading branch information
GoodforGod authored Jan 21, 2025
1 parent c4056d2 commit 160d406
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 5 deletions.
19 changes: 15 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,32 @@

Собрать образ приложения:
```shell
docker build -t kora-java-crud .
docker build -t kora-java-crud-template .
```

## Migration

Накатить миграции
```shell
./gradlew flywayMigrate
```

## Run

Перед запуском локально требуется запустить базу Postgres и накатить миграции.

Запустить локально:
```shell
./gradlew run
```

## Migration
## Run Docker-Compose

Миграции вызываются с помощью Flyway Gradle Plugin:
Требуется сначала собрать артефакт.

Запустить как docker-compose:
```shell
./gradlew flywayMigrate
docker-compose up
```

## Test
Expand Down
38 changes: 38 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
services:
postgres:
image: postgres:16.4-alpine
restart: unless-stopped
ports:
- '5432:5432'
environment:
POSTGRES_DATABASE: postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres


flyway:
image: flyway/flyway:10.2-alpine
restart: no
command: -url=jdbc:postgresql://postgres:5432/postgres -schemas=public -user=postgres -password=postgres -connectRetries=60 migrate
volumes:
- ./src/main/resources/db/migration:/flyway/sql
depends_on:
- postgres


# Можно закомментировать секцию application и использовать docker-compose
# как окружения для запуска сервиса через gradle run
application:
image: kora-java-crud-template
build: .
restart: unless-stopped
ports:
- '8080:8080'
- '8085:8085'
environment:
POSTGRES_JDBC_URL: jdbc:postgresql://postgres:5432/postgres
POSTGRES_USER: postgres
POSTGRES_PASS: postgres
depends_on:
- postgres
- flyway
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
groupId=ru.tinkoff.kora
koraVersion=1.1.17
koraVersion=1.1.18


##### GRADLE #####
Expand Down

0 comments on commit 160d406

Please sign in to comment.