Skip to content

Commit c291348

Browse files
authored
Merge pull request #58 from 398ja/codex/deploy-all-docker-services-using-maven
Publish REST image with Jib during deploy
2 parents 8392596 + fa4c04e commit c291348

3 files changed

Lines changed: 47 additions & 0 deletions

File tree

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,17 @@ EXPOSE 8080
124124
ENTRYPOINT ["java","-jar","/app/app.jar"]
125125
```
126126

127+
## Container Publishing
128+
129+
The `cashu-gateway-rest` module uses the [Jib](https://github.com/GoogleContainerTools/jib) Maven plugin to build and publish a
130+
Docker image. Running:
131+
132+
```bash
133+
./mvnw deploy
134+
```
135+
136+
builds all modules and pushes `docker.398ja.xyz/cashu-gateway-rest:${project.version}`.
137+
127138
## Configuration
128139

129140
| Module | Option / Variable | Description |

cashu-gateway-rest/pom.xml

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,32 @@
8888
<groupId>org.springframework.boot</groupId>
8989
<artifactId>spring-boot-maven-plugin</artifactId>
9090
</plugin>
91+
<plugin>
92+
<groupId>com.google.cloud.tools</groupId>
93+
<artifactId>jib-maven-plugin</artifactId>
94+
<version>3.4.1</version>
95+
<configuration>
96+
<from>
97+
<image>eclipse-temurin:21-jre</image>
98+
</from>
99+
<to>
100+
<image>docker.398ja.xyz/cashu-gateway-rest:${project.version}</image>
101+
</to>
102+
<container>
103+
<ports>
104+
<port>8080</port>
105+
</ports>
106+
</container>
107+
</configuration>
108+
<executions>
109+
<execution>
110+
<phase>deploy</phase>
111+
<goals>
112+
<goal>build</goal>
113+
</goals>
114+
</execution>
115+
</executions>
116+
</plugin>
91117
</plugins>
92118
</build>
93119

docs/docker.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,13 @@ docker build -t cashu-gateway-rest cashu-gateway-rest
1212
docker-compose build
1313
docker-compose up
1414
```
15+
16+
## Publishing with Maven
17+
18+
The project is configured with the [Jib](https://github.com/GoogleContainerTools/jib) Maven plugin. Executing:
19+
20+
```bash
21+
./mvnw deploy
22+
```
23+
24+
builds the REST module and pushes the resulting image to `docker.398ja.xyz/cashu-gateway-rest`.

0 commit comments

Comments
 (0)