File tree Expand file tree Collapse file tree 3 files changed +54
-5
lines changed Expand file tree Collapse file tree 3 files changed +54
-5
lines changed Original file line number Diff line number Diff line change 42
42
43
43
Собрать образ приложения:
44
44
``` shell
45
- docker build -t kora-java-crud .
45
+ docker build -t kora-java-crud-template .
46
+ ```
47
+
48
+ ## Migration
49
+
50
+ Накатить миграции
51
+ ``` shell
52
+ ./gradlew flywayMigrate
46
53
```
47
54
48
55
## Run
49
56
57
+ Перед запуском локально требуется запустить базу Postgres и накатить миграции.
58
+
50
59
Запустить локально:
51
60
``` shell
52
61
./gradlew run
53
62
```
54
63
55
- ## Migration
64
+ ## Run Docker-Compose
56
65
57
- Миграции вызываются с помощью Flyway Gradle Plugin:
66
+ Требуется сначала собрать артефакт.
67
+
68
+ Запустить как docker-compose:
58
69
``` shell
59
- ./gradlew flywayMigrate
70
+ docker-compose up
60
71
```
61
72
62
73
## Test
Original file line number Diff line number Diff line change
1
+ services :
2
+ postgres :
3
+ image : postgres:16.4-alpine
4
+ restart : unless-stopped
5
+ ports :
6
+ - ' 5432:5432'
7
+ environment :
8
+ POSTGRES_DATABASE : postgres
9
+ POSTGRES_USER : postgres
10
+ POSTGRES_PASSWORD : postgres
11
+
12
+
13
+ flyway :
14
+ image : flyway/flyway:10.2-alpine
15
+ restart : no
16
+ command : -url=jdbc:postgresql://postgres:5432/postgres -schemas=public -user=postgres -password=postgres -connectRetries=60 migrate
17
+ volumes :
18
+ - ./src/main/resources/db/migration:/flyway/sql
19
+ depends_on :
20
+ - postgres
21
+
22
+
23
+ # Можно закомментировать секцию application и использовать docker-compose
24
+ # как окружения для запуска сервиса через gradle run
25
+ application :
26
+ image : kora-java-crud-template
27
+ build : .
28
+ restart : unless-stopped
29
+ ports :
30
+ - ' 8080:8080'
31
+ - ' 8085:8085'
32
+ environment :
33
+ POSTGRES_JDBC_URL : jdbc:postgresql://postgres:5432/postgres
34
+ POSTGRES_USER : postgres
35
+ POSTGRES_PASS : postgres
36
+ depends_on :
37
+ - postgres
38
+ - flyway
Original file line number Diff line number Diff line change 1
1
groupId =ru.tinkoff.kora
2
- koraVersion =1.1.17
2
+ koraVersion =1.1.18
3
3
4
4
5
5
# #### GRADLE #####
You can’t perform that action at this time.
0 commit comments