-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
26 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
MONGO_URL=mongodb://localhost:27017/ | ||
DATABASE_NAME=your_database_name | ||
USERNAME_NAME= | ||
USERNAME= | ||
PASSWORD= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
## FastAPI MicroService with Docker, Nginx and MongoDB(Motor) | ||
## FastAPI Micro Service with Docker, Nginx, and Asynchronous MongoDB (Motor) | ||
|
||
### Installation Instruction | ||
- Create [virtual environment](https://docs.python.org/3/library/venv.html) and install requirements | ||
### Installation Instructions | ||
|
||
- Create a [virtual environment](https://docs.python.org/3/library/venv.html) | ||
- Install the python Dependencies with `pip install -r requirements.txt` | ||
- Copy the .env.example file as .env | ||
```sh | ||
cp .env.example .env | ||
``` | ||
- Ensure that you fill in all the valid environment properties in the .env file. | ||
|
||
|
||
### Run Locally | ||
To run the service locally, use the following command: | ||
```sh | ||
pip install -r requirements.txt | ||
uvicorn server:app --reload | ||
``` | ||
- Copy .env.example as .env | ||
|
||
### Run with Docker | ||
To run the service using Docker, use the following command: | ||
```sh | ||
cp .env.example .env | ||
sudo docker-compose up -d --build | ||
``` | ||
### Run docker compose | ||
- Make sure [docker](https://docs.docker.com/engine/install) and [docker-compose](https://docs.docker.com/compose/install/) installed | ||
|
||
### Lets Run with Docker | ||
- Docker run `sudo docker-compose up -d --build` | ||
- Locally run `uvicorn src.servers.start:app --reload` | ||
### Run Docker Compose for Production Build | ||
Ensure that you have [Docker]((https://docs.docker.com/engine/install)) and [Docker Compose](https://docs.docker.com/compose/install/) installed. | ||
|
||
### Lets Run Locally | ||
- Locally run `uvicorn server:app --reload` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters