File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11# Database API
22
3- To run the application:
4- ` uvicorn main:app --reload `
3+ The database API offers a convenient and efficient way to create MySQL and PostgreSQL databases for users on the Crane Cloud platform
4+
5+ # Project Setup
6+
7+ Follow these steps to have a local running copy of the app.
8+
9+ Clone The Repo
10+ ```
11+ git clone https://github.com/crane-cloud/database-api.git
12+ ```
13+
14+ # Running application with Docker
15+
16+ ` make ` is a build automation tool that is used to manage the build process of a software project.
17+
18+ In the project directory, running ` make ` shows you a list of commands to use.
19+
20+ Run ` make start ` to start the application and required services.
21+
22+ Run ` make connect-to-container ` to connect to the FastAPI application container.
Original file line number Diff line number Diff line change 1- version : " 3"
1+ version : " 3.8 "
22services :
33 database-api :
44 restart : always
@@ -9,8 +9,27 @@ services:
99 environment :
1010 PYTHONDONTWRITEBYTECODE : 1
1111 PYTHONUNBUFFERED : 1
12+ DATABASE_USER : postgres
13+ DATABASE_URI : ${DATABASE_URI:-postgresql://postgres:postgres@database:5432/cranecloud}
14+ TEST_DATABASE_URI : ${TEST_DATABASE_URI:-postgresql://postgres:postgres@database:5432/cranecloud_test}
1215 ports :
1316 - " ${APP_PORT:-8000}:8000"
1417 volumes :
1518 - .:/app
16-
19+ depends_on :
20+ - database
21+
22+ database :
23+ restart : always
24+ image : postgres:10.8-alpine
25+ container_name : postgres-database
26+ environment :
27+ POSTGRES_USER : postgres
28+ POSTGRES_DB : cranecloud
29+ ports :
30+ - " 4200:5432"
31+ volumes :
32+ - db-data:/var/lib/postgresql/data
33+
34+ volumes :
35+ db-data :
You can’t perform that action at this time.
0 commit comments