This repository serves as a development environment template for a Flask application.
Download this repository using the link below:
Extract the downloaded ZIP file and navigate to the extracted folder.
Create a .env file and set your Ngrok token by referring to the .env.sample file.
Set up the development environment using venv:
python -m venv .venvActivate the virtual environment:
source .venv/bin/activateInstall dependencies with Poetry:
poetry installTo exit the virtual environment, use the following command:
deactivateTo launch the system, run the following command:
docker-compose -f compose.prod.yaml -f compose.yaml up -dOnce the system is running, you can access Ngrok's URL by opening localhost:4040 in your web browser.
Alternatively, you can start the Flask application directly with:
python flask-app/app.pyWhen running the Flask application directly, open localhost:5001 in your web browser to access the system.
- Ensure you have Docker and Docker Compose installed before running the application.
- Modify the
.envfile with your required environment variables before starting the system. - This template is designed for rapid Flask development and can be customized as needed.
- If you change the
flask-appdirectory name, update the following references accordingly:DockerfileCOPY ./flask-app /src/flask-app/WORKDIR /src/flask-apppyproject.toml[tool.poetry] name = "flask-app"
[[tool.poetry.packages]] include = "flask-app"
.
├── .env.sample
├── Dockerfile
├── README.md
├── compose.prod.yaml
├── compose.yaml
├── flask-app
│ ├── __init__.py
│ ├── app.py
│ ├── static
│ │ ├── favicon.ico
│ │ ├── images
│ │ │ └── sample-image.png
│ │ └── styles
│ │ ├── index.css
│ │ └── layout.css
│ └── templates
│ ├── index.html
│ └── layout.html
├── ngrok.yml
├── poetry.lock
└── pyproject.toml
6 directories, 16 files