File tree 2 files changed +41
-4
lines changed
2 files changed +41
-4
lines changed Original file line number Diff line number Diff line change 1
1
# Database API
2
2
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 "
2
2
services :
3
3
database-api :
4
4
restart : always
@@ -9,8 +9,27 @@ services:
9
9
environment :
10
10
PYTHONDONTWRITEBYTECODE : 1
11
11
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}
12
15
ports :
13
16
- " ${APP_PORT:-8000}:8000"
14
17
volumes :
15
18
- .:/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