diff --git a/day-14/simple-python-app/app.py b/day-14/simple-python-app/app.py index ed673745b..6685ec7c2 100644 --- a/day-14/simple-python-app/app.py +++ b/day-14/simple-python-app/app.py @@ -9,3 +9,9 @@ def hello(): if __name__ == '__main__': app.run() + + + + + + diff --git a/day-14/simple-python-app/buildspec.yml b/day-14/simple-python-app/buildspec.yml index 8cccdf869..5432eb220 100644 --- a/day-14/simple-python-app/buildspec.yml +++ b/day-14/simple-python-app/buildspec.yml @@ -12,11 +12,11 @@ phases: pre_build: commands: - echo "Installing dependencies..." - - pip install -r day-13/simple-python-app/requirements.txt + - pip install -r day-14/simple-python-app/requirements.txt build: commands: - echo "Running tests..." - - cd day-13/simple-python-app/ + - cd day-14/simple-python-app/ - echo "Building Docker image..." - echo "$DOCKER_REGISTRY_PASSWORD" | docker login -u "$DOCKER_REGISTRY_USERNAME" --password-stdin "$DOCKER_REGISTRY_URL" - docker build -t "$DOCKER_REGISTRY_URL/$DOCKER_REGISTRY_USERNAME/simple-python-flask-app:latest" . diff --git a/scripts/start_container.sh b/scripts/start_container.sh index c7617d846..01952d205 100644 --- a/scripts/start_container.sh +++ b/scripts/start_container.sh @@ -2,7 +2,12 @@ set -e # Pull the Docker image from Docker Hub -docker pull abhishekf5/simple-python-flask-app +docker pull bhavyaf5/simple-python-flask-app # Run the Docker image as a container -docker run -d -p 5000:5000 abhishekf5/simple-python-flask-app +docker run -d -p 5000:5000 bhavyaf5/simple-python-flask-app + + + + + diff --git a/scripts/stop_container.sh b/scripts/stop_container.sh index d85f74e93..07344765d 100644 --- a/scripts/stop_container.sh +++ b/scripts/stop_container.sh @@ -1,5 +1,15 @@ #!/bin/bash set -e -# Stop the running container (if any) -echo "Hi" \ No newline at end of file +# Get running container IDs +container_ids=$(docker ps -q) + +# Stop and remove if any +if [ -n "$container_ids" ]; then + echo "Stopping and removing containers: $container_ids" + docker rm -f $container_ids +else + echo "No running containers to stop." +fi + +