update docker and add an automation.sh

This commit is contained in:
Nicholas Mucks 2024-07-14 12:27:36 -07:00
parent ecbab64972
commit a94f441f44
2 changed files with 15 additions and 1 deletions

View file

@ -1,5 +1,5 @@
# Use an official OpenJDK runtime as a parent image
FROM openjdk:17-jdk-alpine
FROM openjdk
# Set the working directory inside the container
WORKDIR /app

14
automation.sh Normal file
View file

@ -0,0 +1,14 @@
echo "####################################################"
echo "Stop and remove all running containers..."
echo "docker stop $(docker ps -a -q)"
echo "docker system prune -af"
docker stop $(docker ps -a -q)
docker system prune -af
echo "####################################################"
echo "Build and run container..."
echo "build . -f spring_image"
echo "docker run -itd --net=assignment2 -p:8080:8080 --name spring-clinic spring_image"
docker build . -f spring_image
docker run -itd --net=assignment2 -p:8080:8080 --name spring-clinic spring_image