Skip to content

Commit ddca232

Browse files
committed
Add application run scripts
1 parent 4d70260 commit ddca232

File tree

4 files changed

+22
-3
lines changed

4 files changed

+22
-3
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# pyflask_config: python_version
22
FROM tiangolo/uwsgi-nginx:python3.8
33

4-
LABEL maintainer="Pritam Sarkar <[email protected]>"
4+
# pyflask_config: docker_maintainer_details
5+
LABEL maintainer="User <[email protected]>"
56

67
#RUN make setup
78
#

Makefile

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
# pyflask_config: python_env_name
12
PYTHON_ENV_NAME=pyflask-base-env
3+
# pyflask_config: service_name
24
APPLICATION_NAME=pyflask-microservice
5+
36
APP_DIR=src
47
TEST_DIR=test
58
HOME_DIR_PY_FILES=*.py
@@ -141,14 +144,25 @@ pre-commit: #: Run pre-commit checks : format, lint, test, cover
141144

142145
debug-run: #: Run application in debug mode
143146
@echo "\n$(BOLD_BLUE)Starting application in debug mode . . .$(RESET_STYLES)"
147+
FLASK_ENV=development python3 service_master.py
144148

145149

146150
dev-run: #: Run application in dev mode
147151
@echo "\n$(BOLD_BLUE)Starting application in dev mode . . .$(RESET_STYLES)"
152+
FLASK_ENV=development python3 service_master.py
148153

149154

150155
prod-run: #: Run application in prod mode
151156
@echo "\n$(BOLD_BLUE)Starting application in prod mode . . .$(RESET_STYLES)"
157+
FLASK_ENV=prod python3 service_master.py
158+
159+
160+
docker-build: #: Build docker image for the application
161+
@echo "\n$(BOLD_BLUE)Building docker image . . .$(RESET_STYLES)"
162+
163+
164+
docker-start: #: Start docker image for the application
165+
@echo "\n$(BOLD_BLUE)Starting dockerized application . . .$(RESET_STYLES)"
152166

153167

154168
clean: #: Clean unnecessary files

docker_build.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
#!/bin/bash
2+
3+
# pyflask_config: service_name
24
app="docker.image.pyflask-microservice"
35
docker build -t ${app} .
4-
docker run -d -p 56733:80 --name=${app} -v $PWD:/app ${app}
6+
docker run -d -p 56733:80 --name=${app} -v "$PWD":/app ${app}

pyflask-preferences.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ python_env_manager: venv
1010
# python_base_version: python base version for the project
1111
# supported python versions: 3.7 | 3.8
1212
python_base_version_major: 3
13-
python_base_version_minor: 8
13+
python_base_version_minor: 8
14+
15+
docker_maintainer_details: User <[email protected]>

0 commit comments

Comments
 (0)