Made changes to the docker file to get it working in ECS.

This commit is contained in:
Joe Bailey 2023-02-12 18:46:40 -08:00
parent 37a0093dd7
commit db264554c5
2 changed files with 13 additions and 4 deletions

View file

@ -1,3 +1,11 @@
FROM openjdk:20-ea-17-jdk FROM openjdk:20-ea-17-jdk
VOLUME /tmp
COPY target/spring-petclinic-3.0.0-SNAPSHOT.jar spring-petclinic-3.0.0-SNAPSHOT.jar COPY target/spring-petclinic-3.0.0-SNAPSHOT.jar spring-petclinic-3.0.0-SNAPSHOT.jar
RUN useradd -d /home/appuser -m -s /bin/bash appuser
USER appuser
HEALTHCHECK --interval=5m --timeout=3s CMD curl -f http://localhost:8080/ || exit 1
ENTRYPOINT ["java","-jar","/spring-petclinic-3.0.0-SNAPSHOT.jar"] ENTRYPOINT ["java","-jar","/spring-petclinic-3.0.0-SNAPSHOT.jar"]

View file

@ -145,14 +145,15 @@ Resources:
ContainerDefinitions: ContainerDefinitions:
- Name: simple-app - Name: simple-app
Image: !Sub ${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${Repository}:${Tag} Image: !Sub ${AWS::AccountId}.dkr.ecr.${AWS::Region}.amazonaws.com/${Repository}:${Tag}
# EntryPoint:
# - /usr/sbin/apache2
# - -D
# - FOREGROUND
Essential: true Essential: true
Memory: 512 Memory: 512
PortMappings: PortMappings:
- ContainerPort: 8080 - ContainerPort: 8080
LogConfiguration:
- LogDriver: awslogs
HealthCheck:
- Command:
- "CMD-SHELL, curl -f http://localhost:8080/ || exit 1"
Environment: Environment:
- Name: Tag - Name: Tag
Value: !Ref Tag Value: !Ref Tag