File tree Expand file tree Collapse file tree 6 files changed +66
-13
lines changed
Expand file tree Collapse file tree 6 files changed +66
-13
lines changed Original file line number Diff line number Diff line change 1+ venv /
Original file line number Diff line number Diff line change @@ -106,4 +106,6 @@ venv.bak/
106106/site
107107
108108# mypy
109- .mypy_cache /
109+ .mypy_cache /
110+
111+ .tool-versions
Original file line number Diff line number Diff line change 1+ FROM python:3.8
2+
3+ WORKDIR /usr/src/app
4+
5+ COPY requirements.txt ./
6+
7+ COPY Makefile ./
8+
9+ RUN make install
10+
11+ COPY . .
12+
13+ RUN make serve-setup
14+
15+ EXPOSE 5000
16+
17+ CMD ["sh" , "-c" , ". /usr/src/app/venv/bin/activate && make serve" ]
Original file line number Diff line number Diff line change 1+ .PHONY : venv install
12UNAME := $(shell uname)
2- install :
3+ venv :
34ifeq ($(UNAME ) , Windows)
4- py -3 -m venv venv; venv\Scripts\activate.bat;
5+ py -3 -m venv venv;
56else
6- virtualenv venv; source ./venv/bin/activate;
7+ python3 -m venv venv
8+ endif
9+
10+ install : venv
11+ ifeq ($(UNAME ) , Windows)
12+ venv\Scripts\activate.bat; \
13+ pip3 install -r requirements.txt;
14+ else
15+ . venv/bin/activate; \
16+ pip3 install -r requirements.txt;
717endif
8- pip3 install -r requirements.txt
918
1019serve-setup :
11- flask init-db; flask run;
12- open-browser :
13- python3 -m webbrowser " http://127.0.0.1:5000" ;
14- serve : open-browser serve-setup
20+ . venv/bin/activate; \
21+ flask init-db;
22+
23+ serve :
24+ . venv/bin/activate; \
25+ flask run --host=0.0.0.0;
Original file line number Diff line number Diff line change @@ -56,32 +56,46 @@ After the above requirements have been met:
5656 cd verify-v2-quickstart-python
5757 ```
5858
59- 1 . Prepare the environment and install dependencies
59+ 2 . Prepare the environment and install dependencies
6060
6161 ``` bash
6262 make install
6363 ```
6464
65- 1 . Set your environment variables
65+ 3 . Set your environment variables
6666
6767 ``` bash
6868 cp .env.example .env
6969 ```
7070
7171 See [ Twilio Account Settings] ( #twilio-account-settings ) to locate the necessary environment variables.
7272
73- 1 . Run the application
73+ 4 . Set the database
74+
75+ ``` bash
76+ make serve-setup
77+ ```
78+
79+ 5 . Run the application
7480
7581 ``` bash
7682 make serve
7783 ```
7884
7985 This will start a development server. It will reload whenever you change any files.
8086
81- 1 . Navigate to [ http://localhost:5000 ] ( http://localhost:5000 )
87+ 6 . Navigate to [ http://localhost:5000 ] ( http://localhost:5000 )
8288
8389That's it!
8490
91+ ### Docker
92+
93+ If you have [ Docker] ( https://www.docker.com/ ) already installed on your machine, you can use our ` docker-compose.yml ` to setup your project.
94+
95+ 1 . Make sure you have the project cloned.
96+ 2 . Setup the ` .env ` file as outlined in the [ Local Development] ( #local-development ) steps.
97+ 3 . Run ` docker-compose up ` .
98+
8599### Tests
86100
87101You can run the tests locally by typing:
Original file line number Diff line number Diff line change 1+ version : " 3.8"
2+ services :
3+ app :
4+ container_name : app
5+ restart : always
6+ build : .
7+ ports :
8+ - " 5000:5000"
You can’t perform that action at this time.
0 commit comments