Made changes to the docker file to get it working in ECS. (#3)

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

* Removed health check from the cloud formation template, since it is
in the docker file now.
This commit is contained in:
Joe Bailey 2023-02-12 18:52:07 -08:00 committed by GitHub
parent 37a0093dd7
commit 40292a7383
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 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,12 @@ 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
Environment: Environment:
- Name: Tag - Name: Tag
Value: !Ref Tag Value: !Ref Tag