Skip to content
Open
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
25 changes: 24 additions & 1 deletion deployments/polling-app-client.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
8 changes: 4 additions & 4 deletions polling-app-server/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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

Expand All @@ -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"]
ENTRYPOINT ["java","-cp","app:app/lib/*","com.example.polls.PollsApplication"]