diff --git a/deployments/polling-app-client.yaml b/deployments/polling-app-client.yaml index 3894097d..a1fb0ec1 100644 --- a/deployments/polling-app-client.yaml +++ b/deployments/polling-app-client.yaml @@ -35,4 +35,27 @@ spec: ports: # Forward incoming connections on port 80 to the target port 80 in the Pod - name: http port: 80 - targetPort: 80 \ No newline at end of file + targetPort: 80 +--- +apiVersion: networking.k8s.io/v1 +kind: Ingress +metadata: + name: polling-app-client + namespace: polling-app + annotations: + alb.ingress.kubernetes.io/certificate-arn: arn:aws:acm:us-east-2:899456967600:certificate/e355d30c-7dcf-4965-8f23-ca3f6b491641 + alb.ingress.kubernetes.io/scheme: internet-facing + alb.ingress.kubernetes.io/target-type: ip +spec: + ingressClassName: alb + rules: + - host: yourdomain.com + http: + paths: + - path: / + pathType: Prefix + backend: + service: + name: polling-app-client + port: + number: 80 diff --git a/polling-app-server/Dockerfile b/polling-app-server/Dockerfile index d6e6af65..1b9707ac 100644 --- a/polling-app-server/Dockerfile +++ b/polling-app-server/Dockerfile @@ -1,5 +1,5 @@ #### Stage 1: Build the application -FROM openjdk:8-jdk-alpine as build +FROM amazoncorretto:11 as build # Set the current working directory inside the image WORKDIR /app @@ -20,11 +20,11 @@ RUN ./mvnw dependency:go-offline -B COPY src src # Package the application -RUN ./mvnw package -DskipTests +RUN ./mvnw package -DskipTests -e RUN mkdir -p target/dependency && (cd target/dependency; jar -xf ../*.jar) #### Stage 2: A minimal docker image with command to run the app -FROM openjdk:8-jre-alpine +FROM amazoncorretto:11 ARG DEPENDENCY=/app/target/dependency @@ -33,4 +33,4 @@ COPY --from=build ${DEPENDENCY}/BOOT-INF/lib /app/lib COPY --from=build ${DEPENDENCY}/META-INF /app/META-INF COPY --from=build ${DEPENDENCY}/BOOT-INF/classes /app -ENTRYPOINT ["java","-cp","app:app/lib/*","com.example.polls.PollsApplication"] \ No newline at end of file +ENTRYPOINT ["java","-cp","app:app/lib/*","com.example.polls.PollsApplication"]