Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions day-14/simple-python-app/app.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from flask import Flask


app = Flask(__name__)

@app.route('/')
Expand All @@ -8,4 +9,5 @@ def hello():

if __name__ == '__main__':
app.run()


4 changes: 2 additions & 2 deletions day-14/simple-python-app/buildspec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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" .
Expand Down
4 changes: 3 additions & 1 deletion day-21/requirements.txt
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
Flask==2.0.1
Flask==2.0.3
Werkzeug==2.0.3

4 changes: 2 additions & 2 deletions scripts/start_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -e

# Pull the Docker image from Docker Hub
docker pull abhishekf5/simple-python-flask-app
docker pull kubeaziz/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 kubeaziz/simple-python-flask-app
2 changes: 1 addition & 1 deletion scripts/stop_container.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
set -e

# Stop the running container (if any)
echo "Hi"
echo "Hi"
8 changes: 8 additions & 0 deletions start_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/bin/bash
set -e

# Pull the Docker image from Docker Hub
docker pull kubeaziz/simple-python-flask-app

# Run the Docker image as a container
docker run -d -p 5000:5000 kubeaziz/simple-python-flask-app
16 changes: 16 additions & 0 deletions stop_container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash
set -e

# Check for running containers
RUNNING_CONTAINERS=$(docker ps -q)

if [ -n "$RUNNING_CONTAINERS" ]; then
echo "Stopping running containers..."
docker stop $RUNNING_CONTAINERS

echo "Removing stopped containers..."
docker rm $RUNNING_CONTAINERS
else
echo "No running containers found."
fi