Test coonfiguration without db

This commit is contained in:
JustFiesta 2024-05-17 15:27:50 +02:00
parent 106b490008
commit 4fa1b394cb
2 changed files with 2 additions and 26 deletions

View file

@ -15,4 +15,5 @@ WORKDIR /app
COPY --from=build /project/target/spring-petclinic-*.jar /app/java-application.jar
ENTRYPOINT [ "java", "-Dspring.profiles.active=postgres", "-jar", "java-application.jar"]
# ENTRYPOINT [ "java", "-Dspring.profiles.active=postgres", "-jar", "java-application.jar"]
ENTRYPOINT [ "java", "-jar", "java-application.jar"]

View file

@ -42,29 +42,6 @@ sudo yum update -y
sudo yum install -y docker
sudo service docker start
echo "---------------------------------------"
echo "Creating docker network for containers..."
docker network create spring-petclinic-network
echo "---------------------------------------"
echo "Running database container for spring-petclinic..."
# Run Postgres whitch is needed for spring-petclinic
docker run -d --name spring-pertlinic-db \
--network spring-petclinic-network \
-e POSTGRES_DB=petclinic \
-e POSTGRES_USER=petclinic \
-e POSTGRES_PASSWORD=petclinic \
-v db-data:/var/lib/postgresql/data \
-p 5432:5432 \
postgres
if [ \$? -eq 0 ]; then
echo "Database container started successfully."
else
echo "Error: Failed to start database container."
exit 1
fi
echo "---------------------------------------"
echo "Authorising ECR..."
# Authorize ECR in Docker using IAM role
@ -79,8 +56,6 @@ echo "---------------------------------------"
echo "Running spring-petclinic container..."
# Run the Docker image
docker run -d --name spring-pertlinic \
--link spring-pertlinic-db:db \
--network spring-petclinic-network \
-p 80:8080 "$AWS_ACCOUNT_ID".dkr.ecr."$REGION".amazonaws.com/"$IMAGE_NAME"
# Check if the docker run command was successful