Skip to content

Commit 1ad7ac2

Browse files
committed
Merge branch 'develop'
2 parents fc68017 + c9a75b7 commit 1ad7ac2

8 files changed

+110
-16
lines changed

README.md

+44-8
Original file line numberDiff line numberDiff line change
@@ -18,33 +18,69 @@ microservices with Python which handles cross-cutting concerns:
1818

1919
# How to run the scaffold
2020

21+
## Instalation
2122
```bash
2223
virtualenv --python=python[3.6|3.7|3.8] venv
2324
source venv/bin/activate
2425
pip install -r requirements.txt
26+
```
27+
28+
## Run your python script
29+
```bash
2530
python manage.py runserver
2631
```
2732

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+
```
2964
3065
Read more info in the documentation page:
3166
https://microservices-scaffold.readthedocs.io/en/latest/
3267
3368
# Docker
34-
35-
Create and push the image
69+
You can dockerize this microservice wit this steps:
70+
* Create and push the image
3671
3772
docker build -t template -f Dockerfile .
38-
39-
Test the image:
73+
* Run the image:
4074
4175
docker run -d -p 5000:5000 template
4276
43-
44-
Push to Kubernetes:
77+
78+
# Kubernetes
79+
You can run this microservice in a Kubernetes cluster with:
4580
4681
kubectl apply -f service.yaml
47-
82+
83+
See a simple tutorial in [the doc](https://microservices-scaffold.readthedocs.io/en/latest/runinkubernetes.html)
4884
4985
## How to contrib
5086

config.yml

+1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ pyms:
44
swagger:
55
path: "swagger"
66
file: "swagger.yaml"
7+
url: "/ui/"
78
tracer:
89
client: "jaeger"
910
host: "localhost"

docs/codeexample.rst

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
Code Examples
22
=============
33

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

docs/configuration.rst

+12-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Configuration
22
=============
33

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.
55
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/>`_
66

77
Documentation
@@ -12,5 +12,16 @@ The Microservice create a URL to inspect the Swagger documentation of the api in
1212
1313
localhost:5000/[APPLICATION_ROOT]/ui/
1414
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+
1526
Our API Rest work with `connexion <http://connexion.readthedocs.io>`_. You can see connexion docs or the official
1627
`Swagger documentation <https://swagger.io/specification/>`_ to add the syntax to your APIS and create your Swagger docs

docs/index.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ Content
3434
:maxdepth: 4
3535

3636
installation
37-
runinkubernetes
3837
quickstart
3938
structure
4039
configuration
4140
codeexample
4241
project
42+
runinkubernetes

docs/installation.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,14 @@ Clone the project
77
88
git clone https://github.com/python-microservices/microservices-scaffold.git
99
10+
Install your virtualenv
11+
1012
.. code-block:: bash
1113
1214
virtualenv --python=python[3.6|3.7|3.8] venv
1315
source venv/bin/activate
1416
pip install -r requirements.txt
15-
python manage.py runserver
17+
1618
1719
Configure your project and the path of your MS. See :doc:`configuration </configuration>` section.
1820

docs/quickstart.rst

+43-3
Original file line numberDiff line numberDiff line change
@@ -4,19 +4,59 @@ Quickstart
44
Scaffold
55
--------
66

7-
Clone and start this scaffold
7+
Clone the project
88

99
.. code-block:: bash
1010
1111
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+
1317
virtualenv --python=python[3.6|3.7|3.8] venv
1418
source venv/bin/activate
1519
pip install -r requirements.txt
20+
21+
Run the script
22+
23+
.. code-block:: bash
24+
1625
python manage.py runserver
1726
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`:
1853

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/" # <!---
2060
2161
Template
2262
--------

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
Flask-SQLAlchemy==2.4.1
22
SQLAlchemy==1.3.11
33
Flask-Script==2.0.6
4-
py-ms==1.4.1
4+
py-ms==1.5.0

0 commit comments

Comments
 (0)