https://github.com/raphaeltm/demo-flask
https://github.com/raphaeltm/demo-flask
Last synced: 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/raphaeltm/demo-flask
- Owner: raphaeltm
- Created: 2024-11-04T18:28:19.000Z (7 months ago)
- Default Branch: pr-test/sample-repo-automation
- Last Pushed: 2024-11-04T18:28:22.000Z (7 months ago)
- Last Synced: 2025-03-14T22:43:14.578Z (2 months ago)
- Language: Python
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# A Simple Flask App
This is a sample of a basic Flask TODO app. The items are stored in memory and are lost when the server is restarted, but it should give you a basic idea of how to get started with Flask on Defang. Note that alognside your .py file, include a requirements.txt so that the Dockerfile can install the necessary packages with pip.
### NOTE:
This sample is a simple Flask app that demonstrates how to create a TODO app using Flask. The items are stored in memory and are lost when the server is restarted. This sample is intended to provide a basic understanding of how to get started with Flask on Defang. **it is not intended for production use**. If you need something production ready, you should use a managed database like Postgres or MySQL.## Essential Setup Files
1. A [Dockerfile](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/).
2. A [compose file](https://docs.defang.io/docs/concepts/compose) to define and run multi-container Docker applications (this is how Defang identifies services to be deployed).
3. A [.dockerignore](https://docs.docker.com/build/building/context/#dockerignore-files) to ignore files that are not needed in the Docker image or will be generated during the build process.## Prerequisite
1. Download [Defang CLI](https://github.com/DefangLabs/defang)
2. If you are using [Defang BYOC](https://docs.defang.io/docs/concepts/defang-byoc), make sure you have properly [authenticated your AWS account (optional)](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html)## A Step-by-Step Guide
1. Open the terminal and type `defang login`
2. Type `defang compose up` in the CLI
3. Your app should be up and running with Defang in minutes!---
Title: Simple Flask App
Short Description: A basic Flask todo app.
Tags: flask, python
Languages: python