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

https://github.com/carmelo0x63/flask-static

Flask
https://github.com/carmelo0x63/flask-static

docker flask python3

Last synced: about 2 months ago
JSON representation

Flask

Awesome Lists containing this project

README

          

# Flask
Flask micro-site

### Setup
1. Create a [virtual environment for Python](https://docs.python.org/3/library/venv.html) in the current directory
```
$ python3 -m venv .

$ source bin/activate
```

2. Activate the virtual environment and install any dependencies
```
(Flask-static) $ python3 -m pip install [--upgrade] pip setuptools wheel

(Flask-static) $ pip3 install -r requirements.txt
```

____

### Run from CLI
```
(Flask-static) $ export FLASK_APP=run.py

(Flask-static) $ flask run --host=0.0.0.0
```
**NOTE**: the `--host=0.0.0.0` part is optional and is meant to make the web server accessible from external hosts. Use with caution!

#### Exit with
CTRL+C to stop the server, `deactivate` to quit the virtual environment

____

### Run as a Docker container
```
$ docker build -t /flask-static:1.0 .

$ docker run -d --name flask-static -p 5000:5000 /flask-static:1.0
```

____

### Resources
- [Flask](https://flask.palletsprojects.com/en/1.1.x/)
- [Getting Started With Flask, A Python Microframework](https://scotch.io/tutorials/getting-started-with-flask-a-python-microframework)
- [Dockerize a Flask App](https://dev.to/riverfount/dockerize-a-flask-app-17ag)