Docker Compose
Deploying RestBI with Docker Compose
Docker Compose simplifies managing multi-container applications by defining services, networks, and volumes in a single YAML file. Here’s how you can deploy RestBI using Docker Compose.
1. Create a docker-compose.yml
File
Create a docker-compose.yml
file in your project directory with the following content:
2. Start the Services
Run the following command to start the RestBI and database services:
This command will:
Start the RestBI server on port 3000.
Set up the PostgreSQL database service.
Mount the
custom-functions
directory for any custom logic you want to include.
Summary
PostgreSQL Database Service (
db
): This service will run a PostgreSQL database instance and create a database namedchinook
with the specified user credentials.RestBI Service (
restbi
): This service will connect to thedb
service using the credentials provided. It will be exposed on port 3000 and will allow requests from whitelisted domains specified inCORS_WHITELIST
.
By linking the RestBI service directly to the PostgreSQL service in the Docker Compose configuration, you create a self-contained environment where both services can communicate seamlessly, making it easier to manage and deploy the entire stack.
Last updated