Skip to content

Commit 5b6442e

Browse files
Merge pull request #267 from DefangLabs/linda-misc-readme
Miscellaneous readme updates
2 parents 6cba37b + 9d2c8b3 commit 5b6442e

File tree

1 file changed

+41
-16
lines changed

1 file changed

+41
-16
lines changed

README.md

Lines changed: 41 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,61 @@
22

33
[![1-click-deploy](https://defang.io/deploy-with-defang.png)](https://portal.defang.dev/redirect?url=https%3A%2F%2Fgithub.com%2Fnew%3Ftemplate_name%3Dsample-flask-template%26template_owner%3DDefangSamples)
44

5-
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.
5+
This is a basic Flask to-do app that can be deployed with Defang. Note that alongside your `.py` file, include a `requirements.txt` so that the Dockerfile can install the necessary packages with pip.
66

7-
### NOTE:
7+
This project is intended to provide a basic understanding of how to get started with Flask on Defang. The items are stored in memory and are lost when the server is restarted. **It is not intended for production use**. If you need something production ready, you should use a managed database like Postgres or MySQL.
88

9-
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.
9+
## Prerequisites
1010

11-
## Essential Setup Files
11+
1. Download [Defang CLI](https://github.com/DefangLabs/defang)
12+
2. (Optional) If you are using [Defang BYOC](https://docs.defang.io/docs/concepts/defang-byoc) authenticate with your cloud provider account
13+
3. (Optional for local development) [Docker CLI](https://docs.docker.com/engine/install/)
1214

13-
1. A [Dockerfile](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/).
14-
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).
15-
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.
15+
## Development
1616

17-
## Prerequisite
17+
To run the application locally, you can use the following command:
1818

19-
1. Download [Defang CLI](https://github.com/DefangLabs/defang)
20-
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)
19+
```bash
20+
docker compose up --build
21+
```
22+
23+
## Configuration
24+
25+
For this sample, you will not need to provide [configuration](https://docs.defang.io/docs/concepts/configuration).
26+
27+
If you wish to provide configuration, see below for an example of setting a configuration for a value named `API_KEY`.
28+
29+
```bash
30+
defang config set API_KEY
31+
```
32+
33+
## Deployment
34+
35+
> [!NOTE]
36+
> Download [Defang CLI](https://github.com/DefangLabs/defang)
37+
38+
### Defang Playground
39+
40+
Deploy your application to the Defang Playground by opening up your terminal and typing:
41+
```bash
42+
defang compose up
43+
```
2144

22-
## A Step-by-Step Guide
45+
### BYOC (AWS)
2346

24-
1. Open the terminal and type `defang login`
25-
2. Type `defang compose up` in the CLI
26-
3. Your app should be up and running with Defang in minutes!
47+
If you want to deploy to your own cloud account, you can use Defang BYOC:
2748

28-
## One click deployment
49+
1. [Authenticate your AWS account](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-configure.html), and check that you have properly set your environment variables like `AWS_PROFILE`, `AWS_REGION`, `AWS_ACCESS_KEY_ID`, and `AWS_SECRET_ACCESS_KEY`.
50+
2. Run in a terminal that has access to your AWS environment variables:
51+
```bash
52+
defang --provider=aws compose up
53+
```
2954

3055
---
3156

3257
Title: Flask
3358

34-
Short Description: A basic Flask to do app.
59+
Short Description: A basic Flask to-do app.
3560

3661
Tags: Flask, Python
3762

0 commit comments

Comments
 (0)