Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 16 additions & 3 deletions api-gateway/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,25 @@ COPY transaction-service/pom.xml transaction-service/pom.xml
COPY notification-service/pom.xml notification-service/pom.xml
COPY api-gateway/pom.xml api-gateway/pom.xml

RUN mvn -q -DskipTests dependency:go-offline -pl ${SERVICE_NAME} -am
RUN mvn -q -DskipTests \
-Dmaven.wagon.http.retryHandler.count=5 \
-Dhttps.protocols=TLSv1.2 \
-Djdk.tls.client.protocols=TLSv1.2 \
dependency:go-offline -pl ${SERVICE_NAME} -am

COPY common-lib/src common-lib/src
COPY ${SERVICE_NAME}/src ${SERVICE_NAME}/src

RUN mvn -q -DskipTests package -pl ${SERVICE_NAME} -am
RUN mvn -q -DskipTests \
-Dmaven.wagon.http.retryHandler.count=5 \
-Dhttps.protocols=TLSv1.2 \
-Djdk.tls.client.protocols=TLSv1.2 \
package -pl ${SERVICE_NAME} -am

RUN set -eux; \
JAR="$(find "/workspace/${SERVICE_NAME}/target" -maxdepth 1 -type f -name '*.jar' ! -name '*-plain.jar' | head -n 1)"; \
test -n "$JAR"; \
cp "$JAR" "/workspace/${SERVICE_NAME}/target/app.jar"

FROM eclipse-temurin:21-jre-jammy AS runtime

Expand All @@ -28,7 +41,7 @@ RUN groupadd -g 10001 app && useradd -u 10001 -g app -m -s /usr/sbin/nologin app

WORKDIR /app

COPY --from=build /workspace/${SERVICE_NAME}/target/*.jar /app/app.jar
COPY --from=build /workspace/${SERVICE_NAME}/target/app.jar /app/app.jar

USER app

Expand Down
2 changes: 1 addition & 1 deletion api-gateway/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.walletcore</groupId>
<artifactId>walletcore-platform</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1</version>
</parent>

<artifactId>walletcore-api-gateway</artifactId>
Expand Down
19 changes: 16 additions & 3 deletions auth-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,25 @@ COPY transaction-service/pom.xml transaction-service/pom.xml
COPY notification-service/pom.xml notification-service/pom.xml
COPY api-gateway/pom.xml api-gateway/pom.xml

RUN mvn -q -DskipTests dependency:go-offline -pl ${SERVICE_NAME} -am
RUN mvn -q -DskipTests \
-Dmaven.wagon.http.retryHandler.count=5 \
-Dhttps.protocols=TLSv1.2 \
-Djdk.tls.client.protocols=TLSv1.2 \
dependency:go-offline -pl ${SERVICE_NAME} -am

COPY common-lib/src common-lib/src
COPY ${SERVICE_NAME}/src ${SERVICE_NAME}/src

RUN mvn -q -DskipTests package -pl ${SERVICE_NAME} -am
RUN mvn -q -DskipTests \
-Dmaven.wagon.http.retryHandler.count=5 \
-Dhttps.protocols=TLSv1.2 \
-Djdk.tls.client.protocols=TLSv1.2 \
package -pl ${SERVICE_NAME} -am

RUN set -eux; \
JAR="$(find "/workspace/${SERVICE_NAME}/target" -maxdepth 1 -type f -name '*.jar' ! -name '*-plain.jar' | head -n 1)"; \
test -n "$JAR"; \
cp "$JAR" "/workspace/${SERVICE_NAME}/target/app.jar"

FROM eclipse-temurin:21-jre-jammy AS runtime

Expand All @@ -28,7 +41,7 @@ RUN groupadd -g 10001 app && useradd -u 10001 -g app -m -s /usr/sbin/nologin app

WORKDIR /app

COPY --from=build /workspace/${SERVICE_NAME}/target/*.jar /app/app.jar
COPY --from=build /workspace/${SERVICE_NAME}/target/app.jar /app/app.jar

USER app

Expand Down
10 changes: 9 additions & 1 deletion auth-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,22 @@
<parent>
<groupId>com.walletcore</groupId>
<artifactId>walletcore-platform</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1</version>
<relativePath>../pom.xml</relativePath>
</parent>

<artifactId>walletcore-auth-service</artifactId>
<name>WalletCore Auth Service</name>
<packaging>jar</packaging>

<dependencies>

<dependency>
<groupId>com.walletcore</groupId>
<artifactId>walletcore-common-lib</artifactId>
<version>${project.version}</version>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter</artifactId>
Expand Down
7 changes: 6 additions & 1 deletion common-lib/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.walletcore</groupId>
<artifactId>walletcore-platform</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1</version>
</parent>

<artifactId>walletcore-common-lib</artifactId>
Expand All @@ -20,5 +20,10 @@
<artifactId>spring-boot-starter-test</artifactId>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
</dependency>
</dependencies>
</project>
22 changes: 22 additions & 0 deletions infrastructure/docker-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,21 @@ From repo root:
docker compose -f infrastructure/docker-compose.yml up -d --build
```

### Option: sequential builds (if `--build` fails due to network)

If you hit transient network/TLS errors while pulling Maven dependencies during image builds, build each service image one-by-one (this avoids parallel downloads).

From repo root:

```bash
docker compose -f infrastructure/docker-compose.yml build walletcore-auth-service
docker compose -f infrastructure/docker-compose.yml build walletcore-wallet-service
docker compose -f infrastructure/docker-compose.yml build walletcore-transaction-service
docker compose -f infrastructure/docker-compose.yml build walletcore-notification-service
docker compose -f infrastructure/docker-compose.yml build walletcore-api-gateway
docker compose -f infrastructure/docker-compose.yml up -d
```

Stop:

```bash
Expand All @@ -149,3 +164,10 @@ docker compose -f infrastructure/docker-compose.yml down -v
- Use `localhost:29092` from your machine.
- Use `kafka:9092` from other containers.

- **View logs for a specific service**
- From repo root:

```bash
docker compose -f infrastructure/docker-compose.yml logs --tail=50 {service name}
```

19 changes: 16 additions & 3 deletions notification-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,25 @@ COPY transaction-service/pom.xml transaction-service/pom.xml
COPY notification-service/pom.xml notification-service/pom.xml
COPY api-gateway/pom.xml api-gateway/pom.xml

RUN mvn -q -DskipTests dependency:go-offline -pl ${SERVICE_NAME} -am
RUN mvn -q -DskipTests \
-Dmaven.wagon.http.retryHandler.count=5 \
-Dhttps.protocols=TLSv1.2 \
-Djdk.tls.client.protocols=TLSv1.2 \
dependency:go-offline -pl ${SERVICE_NAME} -am

COPY common-lib/src common-lib/src
COPY ${SERVICE_NAME}/src ${SERVICE_NAME}/src

RUN mvn -q -DskipTests package -pl ${SERVICE_NAME} -am
RUN mvn -q -DskipTests \
-Dmaven.wagon.http.retryHandler.count=5 \
-Dhttps.protocols=TLSv1.2 \
-Djdk.tls.client.protocols=TLSv1.2 \
package -pl ${SERVICE_NAME} -am

RUN set -eux; \
JAR="$(find "/workspace/${SERVICE_NAME}/target" -maxdepth 1 -type f -name '*.jar' ! -name '*-plain.jar' | head -n 1)"; \
test -n "$JAR"; \
cp "$JAR" "/workspace/${SERVICE_NAME}/target/app.jar"

FROM eclipse-temurin:21-jre-jammy AS runtime

Expand All @@ -28,7 +41,7 @@ RUN groupadd -g 10001 app && useradd -u 10001 -g app -m -s /usr/sbin/nologin app

WORKDIR /app

COPY --from=build /workspace/${SERVICE_NAME}/target/*.jar /app/app.jar
COPY --from=build /workspace/${SERVICE_NAME}/target/app.jar /app/app.jar

USER app

Expand Down
2 changes: 1 addition & 1 deletion notification-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.walletcore</groupId>
<artifactId>walletcore-platform</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1</version>
</parent>

<artifactId>walletcore-notification-service</artifactId>
Expand Down
9 changes: 8 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.walletcore</groupId>
<artifactId>walletcore-platform</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1</version>
<packaging>pom</packaging>
<name>WalletCore Platform</name>

Expand Down Expand Up @@ -51,6 +51,13 @@
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</pluginManagement>
Expand Down
19 changes: 16 additions & 3 deletions transaction-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,25 @@ COPY transaction-service/pom.xml transaction-service/pom.xml
COPY notification-service/pom.xml notification-service/pom.xml
COPY api-gateway/pom.xml api-gateway/pom.xml

RUN mvn -q -DskipTests dependency:go-offline -pl ${SERVICE_NAME} -am
RUN mvn -q -DskipTests \
-Dmaven.wagon.http.retryHandler.count=5 \
-Dhttps.protocols=TLSv1.2 \
-Djdk.tls.client.protocols=TLSv1.2 \
dependency:go-offline -pl ${SERVICE_NAME} -am

COPY common-lib/src common-lib/src
COPY ${SERVICE_NAME}/src ${SERVICE_NAME}/src

RUN mvn -q -DskipTests package -pl ${SERVICE_NAME} -am
RUN mvn -q -DskipTests \
-Dmaven.wagon.http.retryHandler.count=5 \
-Dhttps.protocols=TLSv1.2 \
-Djdk.tls.client.protocols=TLSv1.2 \
package -pl ${SERVICE_NAME} -am

RUN set -eux; \
JAR="$(find "/workspace/${SERVICE_NAME}/target" -maxdepth 1 -type f -name '*.jar' ! -name '*-plain.jar' | head -n 1)"; \
test -n "$JAR"; \
cp "$JAR" "/workspace/${SERVICE_NAME}/target/app.jar"

FROM eclipse-temurin:21-jre-jammy AS runtime

Expand All @@ -28,7 +41,7 @@ RUN groupadd -g 10001 app && useradd -u 10001 -g app -m -s /usr/sbin/nologin app

WORKDIR /app

COPY --from=build /workspace/${SERVICE_NAME}/target/*.jar /app/app.jar
COPY --from=build /workspace/${SERVICE_NAME}/target/app.jar /app/app.jar

USER app

Expand Down
2 changes: 1 addition & 1 deletion transaction-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.walletcore</groupId>
<artifactId>walletcore-platform</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1</version>
</parent>

<artifactId>walletcore-transaction-service</artifactId>
Expand Down
19 changes: 16 additions & 3 deletions wallet-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,25 @@ COPY transaction-service/pom.xml transaction-service/pom.xml
COPY notification-service/pom.xml notification-service/pom.xml
COPY api-gateway/pom.xml api-gateway/pom.xml

RUN mvn -q -DskipTests dependency:go-offline -pl ${SERVICE_NAME} -am
RUN mvn -q -DskipTests \
-Dmaven.wagon.http.retryHandler.count=5 \
-Dhttps.protocols=TLSv1.2 \
-Djdk.tls.client.protocols=TLSv1.2 \
dependency:go-offline -pl ${SERVICE_NAME} -am

COPY common-lib/src common-lib/src
COPY ${SERVICE_NAME}/src ${SERVICE_NAME}/src

RUN mvn -q -DskipTests package -pl ${SERVICE_NAME} -am
RUN mvn -q -DskipTests \
-Dmaven.wagon.http.retryHandler.count=5 \
-Dhttps.protocols=TLSv1.2 \
-Djdk.tls.client.protocols=TLSv1.2 \
package -pl ${SERVICE_NAME} -am

RUN set -eux; \
JAR="$(find "/workspace/${SERVICE_NAME}/target" -maxdepth 1 -type f -name '*.jar' ! -name '*-plain.jar' | head -n 1)"; \
test -n "$JAR"; \
cp "$JAR" "/workspace/${SERVICE_NAME}/target/app.jar"

FROM eclipse-temurin:21-jre-jammy AS runtime

Expand All @@ -28,7 +41,7 @@ RUN groupadd -g 10001 app && useradd -u 10001 -g app -m -s /usr/sbin/nologin app

WORKDIR /app

COPY --from=build /workspace/${SERVICE_NAME}/target/*.jar /app/app.jar
COPY --from=build /workspace/${SERVICE_NAME}/target/app.jar /app/app.jar

USER app

Expand Down
2 changes: 1 addition & 1 deletion wallet-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<parent>
<groupId>com.walletcore</groupId>
<artifactId>walletcore-platform</artifactId>
<version>0.0.1-SNAPSHOT</version>
<version>0.0.1</version>
</parent>

<artifactId>walletcore-wallet-service</artifactId>
Expand Down
Loading