Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/taurus5650/flask_docker_ngrok_practice


https://github.com/taurus5650/flask_docker_ngrok_practice

docker docker-compose docker-container docker-image dockerfile flask ngrok ngrok-server python3

Last synced: 29 days ago
JSON representation

Awesome Lists containing this project

README

        

# Flask + Docker + Ngrok Practice

## Purpose
Build a simple webhook / website, practice how to use ...
1. Poetry
2. Flask
3. Docker
4. Ngrok

## Operation
### Poetry env setup
- When the project start from 0 to 1
```commandline
$ poetry init # Enter No, No, Yes
$ pyenv shell 3.11.9 # If have use pyenv
$ python3 -m venv .venv
$ poetry env use /PATH/flask_docker_ngrok_practice/venv/bin/python3
$ poetry shell
$ poetry add xxx # Package name e.g. poetry add flask
$ poetry lock # Lock file sync with toml
$ poetry export --without-hashes --without-urls | awk '{ print $1 }' FS=';' > requirements.txt # Optional if need export requirements.txt
```

- When clone the repo from others
```commandline
$ poetry install
$ poetry shell
```

### Coding
Coding ... ...

### Provide Ngrok Token
Input token to ngrok.yml.
The token get from https://dashboard.ngrok.com/get-started/your-authtoken
![ngrok_token.png](readme%2Fngrok_token.png)

### After all done then build up the webhook / website
```commandline
$ docker-compose build
$ docker-compose up
```
![url.png](readme%2Furl.png)

### Happy Testing
https://fa96-118-167-218-47.ngrok-free.app
![img.png](readme%2Fimg.png)