- Prerequisites
- Other Docs
- Setting Up the Project
- Running the Containers
- Usage
- Destroying the Containers
- References
Before you begin, ensure you have the following installed & running properly on your server:
- Docker Desktop
- WSL (Windows Subsystem for Linux) if the server OS is Windows
Head to other deployment readme files: -
To obtain a valid SSL certificate for your server, open bash terminal and run the following command:
openssl req -x509 -nodes -days 365 -newkey rsa:2048 -keyout server.key.pem -out server.crt.pem
This will generate two files on the home directory of the server:
- SSL certificate file (
server.key.pem
) - SSL certificate key file (
server.crt.pem
)
The docker-compose.yml
file requires proper environment variables set before execution.
Following the .env.example
file, create another file .env
in the same directory, and set proper values. DO NOT expose them!
Skip this if you are not developing API or writing code and debug.
Open Developer PowerShell from project root directory & run the following commands:
setx API__ConnectionStrings__DatabaseConnectionString "<connection_string_here>"
setx API__ClientApplication__AllowedOrigins "http://localhost:3000" (if frontend is running on this domain)
setx API__Keycloak__Host "http://localhost:9990"
setx API__Keycloak__Realm "RideSharing"
Open Terminal from project /docker directory and run the following command to run all containers in detached mode:
docker compose -f docker-compose-keycloak.prod.yml -f docker-compose-postgres.yml -f docker-compose-rabbitmq.yml -f docker-compose-redis.yml up -d
Open Terminal from project /docker directory and run the following command to run all containers in detached mode:
docker compose -f docker-compose-keycloak.dev.yml -f docker-compose-postgres.yml -f docker-compose-rabbitmq.yml -f docker-compose-redis.yml up -d
-
Access RideSharing API through
https:localhost:4000
.GET https://localhost:4000
returnsRideSharing.InternalAPI is running
message. -
Access RideSharing Customer API through
https:localhost:5000
.GET https://localhost:5000
returnsRideSharing.CustomerAPI is running
message.
- Access Local MailHog Server through
http://localhost:8025
(only for dev env).
Run the following command to destroy all containers:
docker compose down
To learn more about each of these topics, head to the following documentations:-