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
- Host: GitHub
- URL: https://github.com/carmelo0x63/flask-static
- Owner: carmelo0x63
- License: gpl-3.0
- Created: 2020-05-06T15:43:22.000Z (about 6 years ago)
- Default Branch: main
- Last Pushed: 2024-01-11T20:50:18.000Z (over 2 years ago)
- Last Synced: 2025-03-23T20:06:12.561Z (over 1 year ago)
- Topics: docker, flask, python3
- Language: Python
- Size: 29.3 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)