Skip to content

Commit 91f081c

Browse files
author
Paul Gichure
committed
Dockerfile updates
1 parent 22477e1 commit 91f081c

File tree

20 files changed

+60
-60
lines changed

20 files changed

+60
-60
lines changed

SETUP.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
##Setup
33
Pull RabbitMq Docker image
44
Install MySQL
5-
Intall Java (1.8+)
5+
Intall Java (21+)
66

77

88
##Running

configurations-service/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#### Stage 1: Build the application
2-
FROM openjdk:8-jdk-alpine as build
2+
FROM maven:3.9.9-eclipse-temurin-23-alpine AS build
33

44
LABEL maintainer="Paul Gichure"
55

@@ -13,6 +13,9 @@ COPY .mvn .mvn
1313
# Copy the pom.xml file
1414
COPY pom.xml .
1515

16+
RUN dos2unix mvnw
17+
18+
RUN chmod a+x ./mvnw
1619
# Build all the dependencies in preparation to go offline.
1720
# This is a separate step so the dependencies will be cached unless
1821
# the pom.xml file has changed.
@@ -26,7 +29,7 @@ RUN ./mvnw package -DskipTests
2629
RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar)
2730

2831
#### Stage 2: A minimal docker image with command to run the app
29-
FROM openjdk:8-jre-alpine
32+
FROM eclipse-temurin:23-jre-alpine
3033

3134
ARG DEPENDENCY=/app/target/dependency
3235

configurations-service/pom.xml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,29 +30,31 @@
3030
<maven.compiler.source>21</maven.compiler.source>
3131
<maven.compiler.target>21</maven.compiler.target>
3232
<java.version>21</java.version>
33-
<spring-cloud.version>4.2.0</spring-cloud.version>
33+
<spring-cloud.version>2024.0.0</spring-cloud.version>
3434
</properties>
3535
<dependencyManagement>
36-
<!--<dependencies>
36+
<dependencies>
3737
<dependency>
3838
<groupId>org.springframework.cloud</groupId>
3939
<artifactId>spring-cloud-dependencies</artifactId>
4040
<version>${spring-cloud.version}</version>
4141
<type>pom</type>
4242
<scope>import</scope>
4343
</dependency>
44-
</dependencies>-->
44+
</dependencies>
4545
</dependencyManagement>
4646
<dependencies>
4747
<dependency>
4848
<groupId>org.springframework.cloud</groupId>
4949
<artifactId>spring-cloud-config-server</artifactId>
50-
<version>${spring-cloud.version}</version>
5150
</dependency>
5251
<dependency>
5352
<groupId>org.springframework.cloud</groupId>
5453
<artifactId>spring-cloud-starter-netflix-eureka-client</artifactId>
55-
<version>${spring-cloud.version}</version>
54+
</dependency>
55+
<dependency>
56+
<groupId>org.springframework.boot</groupId>
57+
<artifactId>spring-boot-starter-web</artifactId>
5658
</dependency>
5759
<dependency>
5860
<groupId>org.springframework.boot</groupId>

configurations-service/src/main/java/com/pgichure/eprocure/configurations/ConfigurationServiceApplication.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,10 @@
66
import org.springframework.boot.SpringApplication;
77
import org.springframework.boot.autoconfigure.SpringBootApplication;
88
import org.springframework.cloud.config.server.EnableConfigServer;
9-
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
10-
119
/**
1210
* @author pgichure
1311
*
1412
*/
15-
@EnableEurekaClient
1613
@SpringBootApplication
1714
@EnableConfigServer
1815
public class ConfigurationServiceApplication {

discovery-service/Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#### Stage 1: Build the application
2-
FROM openjdk:8-jdk-alpine as build
2+
FROM eclipse-temurin:23-jdk-alpine AS build
33

44
LABEL maintainer="Paul Gichure"
55

@@ -13,6 +13,10 @@ COPY .mvn .mvn
1313
# Copy the pom.xml file
1414
COPY pom.xml .
1515

16+
RUN dos2unix mvnw
17+
18+
RUN chmod a+x ./mvnw
19+
1620
# Build all the dependencies in preparation to go offline.
1721
# This is a separate step so the dependencies will be cached unless
1822
# the pom.xml file has changed.
@@ -26,7 +30,7 @@ RUN ./mvnw package -DskipTests
2630
RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar)
2731

2832
#### Stage 2: A minimal docker image with command to run the app
29-
FROM openjdk:8-jre-alpine
33+
FROM eclipse-temurin:23-jre-alpine
3034

3135
ARG DEPENDENCY=/app/target/dependency
3236

discovery-service/pom.xml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,12 @@
1212
<name>E-Procurement System Discovery Service</name>
1313
<properties>
1414
<java.version>21</java.version>
15-
<spring-cloud.version>4.2.0</spring-cloud.version>
15+
<spring-cloud.version>2024.0.0</spring-cloud.version>
1616
</properties>
1717
<dependencies>
1818
<dependency>
1919
<groupId>org.springframework.cloud</groupId>
2020
<artifactId>spring-cloud-starter-netflix-eureka-server</artifactId>
21-
<version>${spring-cloud.version}</version>
2221
</dependency>
2322
<dependency>
2423
<groupId>org.springframework.boot</groupId>
@@ -30,15 +29,15 @@
3029
</dependency>
3130
</dependencies>
3231
<dependencyManagement>
33-
<!--<dependencies>
32+
<dependencies>
3433
<dependency>
3534
<groupId>org.springframework.cloud</groupId>
3635
<artifactId>spring-cloud-dependencies</artifactId>
3736
<version>${spring-cloud.version}</version>
3837
<type>pom</type>
3938
<scope>import</scope>
4039
</dependency>
41-
</dependencies>-->
40+
</dependencies>
4241
</dependencyManagement>
4342
<build>
4443
<finalName>${project.artifactId}-${project.version}</finalName>

docker-compose.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: '3.7'
1+
#version: '3.7'
22

33
services:
44
discovery-service:
@@ -16,7 +16,7 @@ services:
1616
- 8761:8761
1717
depends_on:
1818
- rabbitmq
19-
network_mode: "host"
19+
# network_mode: "host"
2020
networks:
2121
- eprocure-network
2222
configurations-service:
@@ -140,7 +140,7 @@ services:
140140
networks:
141141
- eprocure-network
142142
rabbitmq:
143-
image: rabbitmq:3.9.20-management
143+
image: rabbitmq:4.1-rc
144144
container_name: rabbitmq
145145
restart: always
146146
ports:
@@ -149,7 +149,7 @@ services:
149149
networks:
150150
- eprocure-network
151151
mysql:
152-
image: mysql:8.0.29
152+
image: mysql:8.4
153153
container_name: mysql
154154
ports:
155155
- 3307:3307
@@ -160,3 +160,4 @@ services:
160160
MYSQL_PASSWORD: Dev123#@!
161161
networks:
162162
eprocure-network:
163+
driver: bridge

employees-service/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#### Stage 1: Build the application
2-
FROM openjdk:8-jdk-alpine as build
2+
FROM eclipse-temurin:23-jdk-alpine AS build
33
LABEL maintainer="Paul Gichure"
44
# Set the current working directory inside the image
55
WORKDIR /app
@@ -11,6 +11,9 @@ COPY .mvn .mvn
1111
# Copy the pom.xml file
1212
COPY pom.xml .
1313

14+
RUN dos2unix mvnw
15+
16+
RUN chmod a+x ./mvnw
1417
# Build all the dependencies in preparation to go offline.
1518
# This is a separate step so the dependencies will be cached unless
1619
# the pom.xml file has changed.
@@ -24,7 +27,7 @@ RUN ./mvnw package -DskipTests
2427
RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar)
2528

2629
#### Stage 2: A minimal docker image with command to run the app
27-
FROM openjdk:8-jre-alpine
30+
FROM eclipse-temurin:23-jre-alpine
2831

2932
ARG DEPENDENCY=/app/target/dependency
3033

employees-service/src/main/java/com/pgichure/eprocure/employees/EmployeesServiceApplication.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import org.springframework.beans.factory.annotation.Value;
88
import org.springframework.boot.SpringApplication;
99
import org.springframework.boot.autoconfigure.SpringBootApplication;
10-
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
1110
import org.springframework.context.annotation.Bean;
1211

1312
import io.swagger.v3.oas.models.OpenAPI;
@@ -21,7 +20,6 @@
2120
* @author pgichure
2221
*
2322
*/
24-
@EnableEurekaClient
2523
@SpringBootApplication
2624
public class EmployeesServiceApplication {
2725

gateway-service/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#### Stage 1: Build the application
2-
FROM openjdk:8-jdk-alpine as build
2+
FROM eclipse-temurin:23-jdk-alpine AS build
33

44
LABEL maintainer="Paul Gichure"
55

@@ -13,6 +13,9 @@ COPY .mvn .mvn
1313
# Copy the pom.xml file
1414
COPY pom.xml .
1515

16+
RUN dos2unix mvnw
17+
18+
RUN chmod a+x ./mvnw
1619
# Build all the dependencies in preparation to go offline.
1720
# This is a separate step so the dependencies will be cached unless
1821
# the pom.xml file has changed.
@@ -26,7 +29,7 @@ RUN ./mvnw package -DskipTests
2629
RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar)
2730

2831
#### Stage 2: A minimal docker image with command to run the app
29-
FROM openjdk:8-jre-alpine
32+
FROM eclipse-temurin:23-jre-alpine
3033

3134
ARG DEPENDENCY=/app/target/dependency
3235

0 commit comments

Comments
 (0)