File tree 7 files changed +25
-9
lines changed
7 files changed +25
-9
lines changed Original file line number Diff line number Diff line change 1
1
.git
2
- __pycache__
2
+ __pycache__
3
+ . /scripts
Original file line number Diff line number Diff line change @@ -159,5 +159,6 @@ cython_debug/
159
159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160
160
# .idea/
161
161
162
+ Instructions.md
162
163
163
- Instructions.md
164
+ .idea
Original file line number Diff line number Diff line change @@ -24,8 +24,10 @@ help: ##@target Show target help options.
24
24
@perl -e ' $(HELP_FUN)' $(MAKEFILE_LIST )
25
25
26
26
start-app-db : FORCE # #@target Starts the app and db with sample data dump
27
- docker compose up -d ; \
28
- docker compose exec db /bin/bash ./opt/upload.sh
27
+ ./scripts/start.sh
28
+
29
+ stop-app-db : FORCE # #@target stops the app and db with sample data dump
30
+ docker compose down && docker container prune -f && docker rmi abhisheksr01/python-postgres-azure:0.0.1 -f && docker ps -a
29
31
30
32
clear : FORCE # #@target Clears the "__pycache__" & ".pytest_cache". Will be required to run twice.
31
33
@find . -name " __pycache__" -exec rm -rf {} \;
Original file line number Diff line number Diff line change 1
- #! /usr/bin/env bash
2
- psql -h localhost -U postgres < ./opt/rates.sql
3
- psql -h localhost -U postgres -c " SELECT 'alive'"
4
- psql -h localhost -U postgres -c " SELECT current_database();"
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ version: '3'
3
3
services :
4
4
app :
5
5
image : ' abhisheksr01/python-postgres-azure:0.0.1'
6
+ restart : on-failure
6
7
build :
7
8
context : .
8
9
container_name : app
@@ -24,4 +25,5 @@ services:
24
25
- POSTGRES_USER=postgres
25
26
- POSTGRES_PASSWORD=secret
26
27
volumes :
27
- - ./db/:/opt/
28
+ - ./db/:/opt/
29
+ - ./scripts/upload.sh:/opt/upload.sh
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ echo " ** Starting the app and db"
3
+ docker compose up -d
4
+ echo " ** Sleeping for 10 sec to ensure db services are running before uploading dump data"
5
+ sleep 10
6
+ echo " ** Uploading dump data & then sleeping for 5 sec **"
7
+ docker compose exec db /bin/bash ./opt/upload.sh
8
+ sleep 5
9
+ echo " Performing Health Check on the App"
10
+ curl " http://127.0.0.1:3000/"
Original file line number Diff line number Diff line change
1
+ #! /usr/bin/env bash
2
+ psql -h localhost -U postgres < ./opt/rates.sql
3
+ psql -h localhost -U postgres -c " SELECT 'alive'"
4
+ psql -h localhost -U postgres -c " SELECT current_database();"
You can’t perform that action at this time.
0 commit comments