Skip to content

Commit f8a989c

Browse files
committed
chore: update docker scripts and docs
1 parent 42854f0 commit f8a989c

File tree

16 files changed

+23
-82
lines changed

16 files changed

+23
-82
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

.docker/scripts/develop

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
docker-compose -f .docker/docker-compose.dev.yml --env-file .docker/.env $@

.docker/scripts/mvn

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
docker-compose -f .docker/docker-compose.dev.yml --env-file .docker/.env exec -it api mvn $@

.docker/scripts/production

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/bash
2+
docker-compose -f .docker/docker-compose.prod.yml --env-file .docker/.env $@

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
docker/.env
2-
docker/.volumes
1+
.docker/.env
2+
.docker/.volumes
33
Vendas.iml
44
.idea
55
.vscode/settings.json
File renamed without changes.

api/.vscode/launch.json renamed to .vscode/launch.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
"type": "java",
99
"name": "Debug (local)",
1010
"request": "launch",
11-
"mainClass": "com.github.throyer.common.springboot.Application"
11+
"mainClass": "com.github.throyer.common.springboot.Application",
12+
"cwd": "${workspaceFolder}/api"
1213
},
1314
{
1415
"type": "java",

README.md

Lines changed: 13 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,12 @@ Once the application is up, it is available at: [localhost:8080/documentation](l
102102
## Database Migrations
103103
Creating database migration files
104104

105-
> 🚨 make sure you have maven in your environment
106-
and that you are in the correct directory __./api__
107-
105+
> 🚨 make sure you have maven in your environment and that you are in the correct directory __./api__
106+
>
107+
> if you using docker-compose
108+
> ```
109+
> .docker/scripts/mvn migration:generate -Dname=my-migration-name
110+
> ```
108111
109112
- Java based migrations
110113
```bash
@@ -123,41 +126,25 @@ and that you are in the correct directory __./api__
123126
> 🚨 create `environment` file and add permission to execute scripts
124127
>
125128
> ```shell
126-
> cp docker/.env.example docker/.env
129+
> cp .docker/.env.example .docker/.env && chmod -R +x .docker/scripts
127130
> ```
128-
>
129-
> ```shell
130-
> chmod -R +x scripts/
131-
> ```
132-
133-
- docker compose development
134-
```bash
135-
docker-compose -p example-api-development -f ./docker/docker-compose.dev.yml --env-file ./docker/.env up -d --force-recreate
136-
```
137-
138-
- docker compose production
139-
```bash
140-
docker-compose -p example-api -f ./docker/docker-compose.prod.yml --env-file ./docker/.env up -d --build
141-
```
142-
143-
or
144131
145-
- development up / down
132+
- docker-compose for development
146133
```
147-
scripts/dev.sh up
134+
.docker/scripts/develop up -d
148135
```
149136
150137
```
151-
scripts/dev.sh down
138+
.docker/scripts/develop down
152139
```
153140

154-
- production up / down
141+
- docker-compose for production
155142
```
156-
scripts/prod.sh up
143+
.docker/scripts/production up -d --build
157144
```
158145

159146
```
160-
scripts/prod.sh down
147+
.docker/scripts/production down
161148
```
162149

163150
## Environment variables

0 commit comments

Comments
 (0)