File tree 8 files changed +110
-16
lines changed
8 files changed +110
-16
lines changed Original file line number Diff line number Diff line change @@ -18,33 +18,69 @@ microservices with Python which handles cross-cutting concerns:
18
18
19
19
# How to run the scaffold
20
20
21
+ ## Instalation
21
22
``` bash
22
23
virtualenv --python=python[3.6| 3.7| 3.8] venv
23
24
source venv/bin/activate
24
25
pip install -r requirements.txt
26
+ ```
27
+
28
+ ## Run your python script
29
+ ``` bash
25
30
python manage.py runserver
26
31
```
27
32
28
- Open in your browser http://localhost:5000/template/ui/
33
+ ## Check the result
34
+
35
+ Your default endpoint will be in this url:
36
+ ``` bash
37
+ http://127.0.0.1:5000/template/
38
+ ```
39
+
40
+ This URL is setted in your ` config.yml ` :
41
+
42
+ ``` yaml
43
+ ms :
44
+ DEBUG : false
45
+ TESTING : false
46
+ APP_NAME : Template
47
+ APPLICATION_ROOT : /template # <!---
48
+ ` ` `
49
+
50
+ You can acceded to a [swagger ui](https://swagger.io/tools/swagger-ui/) in the next url:
51
+ ` ` ` bash
52
+ http://127.0.0.1:5000/template/ui/
53
+ ```
54
+
55
+ This PATH is setted in your ` config.yml ` :
56
+
57
+ ``` yaml
58
+ pyms :
59
+ swagger :
60
+ path : " swagger"
61
+ file : " swagger.yaml"
62
+ url : " /ui/" # <!---
63
+ ` ` `
29
64
30
65
Read more info in the documentation page:
31
66
https://microservices-scaffold.readthedocs.io/en/latest/
32
67
33
68
# Docker
34
-
35
- Create and push the image
69
+ You can dockerize this microservice wit this steps:
70
+ * Create and push the image
36
71
37
72
docker build -t template -f Dockerfile .
38
-
39
- Test the image:
73
+ * Run the image:
40
74
41
75
docker run -d -p 5000:5000 template
42
76
43
-
44
- Push to Kubernetes:
77
+
78
+ # Kubernetes
79
+ You can run this microservice in a Kubernetes cluster with:
45
80
46
81
kubectl apply -f service.yaml
47
-
82
+
83
+ See a simple tutorial in [the doc](https://microservices-scaffold.readthedocs.io/en/latest/runinkubernetes.html)
48
84
49
85
## How to contrib
50
86
Original file line number Diff line number Diff line change 4
4
swagger :
5
5
path : " swagger"
6
6
file : " swagger.yaml"
7
+ url : " /ui/"
7
8
tracer :
8
9
client : " jaeger"
9
10
host : " localhost"
Original file line number Diff line number Diff line change 1
1
Code Examples
2
2
=============
3
3
4
- See simple examples in https://github.com/python-microservices/pyms/tree/master/examples
4
+ * See simple examples in https://github.com/python-microservices/pyms/tree/master/examples
5
+
6
+ * Build a Chat with 3 Microservices and Kubernetes: https://github.com/python-microservices/microservices-chat
7
+
8
+ * Build a Chat with 4 Microservices and Docker Compose: https://github.com/avara1986/pivoandcode-2019-11-15
Original file line number Diff line number Diff line change 1
1
Configuration
2
2
=============
3
3
4
- Project configuration is loaded using py-ms package based on yml or json file.
4
+ Project configuration is loaded using ` PyMS < https://github.com/python-microservices/pyms >`_ package based on yml or json file.
5
5
Some example files are config.yml, config-docker.yml and tests/config-tests.yml or see `PyMS configuration <https://py-ms.readthedocs.io/en/latest/configuration/ >`_
6
6
7
7
Documentation
@@ -12,5 +12,16 @@ The Microservice create a URL to inspect the Swagger documentation of the api in
12
12
13
13
localhost:5000/[APPLICATION_ROOT]/ui/
14
14
15
+ This URL is setted in your `config.yml `:
16
+
17
+ .. code-block :: yaml
18
+
19
+ ms :
20
+ DEBUG : false
21
+ TESTING : false
22
+ APP_NAME : Template
23
+ APPLICATION_ROOT : /template # <!---
24
+
25
+
15
26
Our API Rest work with `connexion <http://connexion.readthedocs.io >`_. You can see connexion docs or the official
16
27
`Swagger documentation <https://swagger.io/specification/ >`_ to add the syntax to your APIS and create your Swagger docs
Original file line number Diff line number Diff line change @@ -34,9 +34,9 @@ Content
34
34
:maxdepth: 4
35
35
36
36
installation
37
- runinkubernetes
38
37
quickstart
39
38
structure
40
39
configuration
41
40
codeexample
42
41
project
42
+ runinkubernetes
Original file line number Diff line number Diff line change @@ -7,12 +7,14 @@ Clone the project
7
7
8
8
git clone https://github.com/python-microservices/microservices-scaffold.git
9
9
10
+ Install your virtualenv
11
+
10
12
.. code-block :: bash
11
13
12
14
virtualenv --python=python[3.6| 3.7| 3.8] venv
13
15
source venv/bin/activate
14
16
pip install -r requirements.txt
15
- python manage.py runserver
17
+
16
18
17
19
Configure your project and the path of your MS. See :doc: `configuration </configuration >` section.
18
20
Original file line number Diff line number Diff line change @@ -4,19 +4,59 @@ Quickstart
4
4
Scaffold
5
5
--------
6
6
7
- Clone and start this scaffold
7
+ Clone the project
8
8
9
9
.. code-block :: bash
10
10
11
11
git clone https://github.com/python-microservices/microservices-scaffold.git
12
- cd microservices-scaffold
12
+
13
+ Install your virtualenv
14
+
15
+ .. code-block :: bash
16
+
13
17
virtualenv --python=python[3.6| 3.7| 3.8] venv
14
18
source venv/bin/activate
15
19
pip install -r requirements.txt
20
+
21
+ Run the script
22
+
23
+ .. code-block :: bash
24
+
16
25
python manage.py runserver
17
26
27
+ *Check the result *
28
+
29
+ Your default endpoint will be in this url:
30
+
31
+ .. code-block :: bash
32
+
33
+ http://127.0.0.1:5000/template/
34
+
35
+
36
+ This URL is setted in your `config.yml `:
37
+
38
+ .. code-block :: yaml
39
+
40
+ ms :
41
+ DEBUG : false
42
+ TESTING : false
43
+ APP_NAME : Template
44
+ APPLICATION_ROOT : /template # <!---
45
+
46
+ You can acceded to a `swagger ui <https://swagger.io/tools/swagger-ui/ >`_ in the next url:
47
+
48
+ .. code-block :: bash
49
+ http://127.0.0.1:5000/template/ui/
50
+
51
+
52
+ This PATH is setted in your `config.yml `:
18
53
19
- Open in your browser http://localhost:8080/template/ui/
54
+ .. code-block :: yaml
55
+ pyms :
56
+ swagger :
57
+ path : " swagger"
58
+ file : " swagger.yaml"
59
+ url : " /ui/" # <!---
20
60
21
61
Template
22
62
--------
Original file line number Diff line number Diff line change 1
1
Flask-SQLAlchemy == 2.4.1
2
2
SQLAlchemy == 1.3.11
3
3
Flask-Script == 2.0.6
4
- py-ms == 1.4.1
4
+ py-ms == 1.5.0
You can’t perform that action at this time.
0 commit comments