Skip to content

Repository files navigation

Overview

This project contains containerized Flask API, MySQL DB and Next.js front-end. The project also contains Terraform code with which the infrastructure can be provissioned on AWS.

Development

For development use docker compose.

You must create a secrets dir in the root of the project and create the following files:

db_name
db_password
db_root_password
db_user

Start the containers:

docker compose up -d --build

Stop the containers:

docker compose down

You can find autogenerated API docs at:

http://localhost:8000/api/docs

Production

First you need to manually create a key/value secret in AWS Secrets Manager with the following keys:

MYSQL_ROOT_PASSWORD
MYSQL_DATABASE
MYSQL_USER
MYSQL_PASSWORD

And to update the db_details_secret variable in ./terraform/variables.tf with the secret's name.

Other relevant variables such as aws_region, aws_account_id should also be updated if there are changes in that.

You can create/update the infrastructure with terraform:

cd terraform
terraform init
terraform plan
terraform apply

And you can also destroy it:

terraform destroy

About

Terraform, AWS (VPC, ECS), Python, MySQL, Next.js

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages