-
-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from CyrilBaah/metabase
Add metabase
- Loading branch information
Showing
5 changed files
with
132 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# Database environment | ||
DB_NAME=metabase | ||
DB_USER=metabase | ||
DB_PASSWORD=password123 | ||
DB_DATA_DIR=/var/lib/postgresql/data | ||
|
||
# Metabase environment | ||
MB_PORT=3000 | ||
MB_JAVA_TIMEZONE=Asia/Tehran |
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 |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# Metabase Docker Compose Configuration | ||
|
||
This Docker Compose configuration allows you to set up [Metabase](https://www.metabase.com/) along with a PostgreSQL database. | ||
|
||
## Version | ||
|
||
This configuration is designed for Metabase version 3.9. | ||
|
||
## Services | ||
|
||
### Metabase | ||
|
||
- **Image**: metabase/metabase:latest | ||
- **Container Name**: metabase | ||
- **Hostname**: metabase | ||
- **Volumes**: | ||
- `/dev/urandom:/dev/random:ro` | ||
- **Ports**: | ||
- `3000:3000` | ||
- **Environment Variables**: | ||
- `MB_DB_TYPE`: postgres | ||
- `MB_DB_DBNAME`: metabase | ||
- `MB_DB_PORT`: 5432 | ||
- `MB_DB_USER_FILE`: /run/secrets/db_user | ||
- `MB_DB_PASS_FILE`: /run/secrets/db_password | ||
- `MB_DB_HOST`: postgres | ||
- **Network**: metanet1 | ||
- **Secrets**: | ||
- db_password | ||
- db_user | ||
- **Healthcheck**: | ||
- Test: `curl --fail -I http://localhost:3000/api/health || exit 1` | ||
- Interval: 15s | ||
- Timeout: 5s | ||
- Retries: 5 | ||
|
||
### PostgreSQL | ||
|
||
- **Image**: postgres:latest | ||
- **Container Name**: postgres | ||
- **Hostname**: postgres | ||
- **Environment Variables**: | ||
- `POSTGRES_USER_FILE`: /run/secrets/db_user | ||
- `POSTGRES_DB`: metabase | ||
- `POSTGRES_PASSWORD_FILE`: /run/secrets/db_password | ||
- **Network**: metanet1 | ||
- **Secrets**: | ||
- db_password | ||
- db_user | ||
|
||
## Networks | ||
|
||
- **Name**: metanet1 | ||
- **Driver**: bridge | ||
|
||
## Secrets | ||
|
||
### db_password | ||
|
||
- **File**: db_password.txt | ||
|
||
### db_user | ||
|
||
- **File**: db_user.txt | ||
|
||
## Usage | ||
|
||
1. Make sure you have Docker and Docker Compose installed on your system. | ||
2. Create the `db_password.txt` and `db_user.txt` files with your PostgreSQL password and username, respectively. | ||
3. Run the following command to start Metabase and PostgreSQL: | ||
|
||
```bash | ||
docker-compose up -d |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
password123 |
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 |
---|---|---|
@@ -0,0 +1 @@ | ||
metabase |
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 |
---|---|---|
@@ -0,0 +1,48 @@ | ||
version: '3.9' | ||
services: | ||
metabase: | ||
image: metabase/metabase:latest | ||
container_name: metabase | ||
hostname: metabase | ||
volumes: | ||
- /dev/urandom:/dev/random:ro | ||
ports: | ||
- 3000:3000 | ||
environment: | ||
MB_DB_TYPE: postgres | ||
MB_DB_DBNAME: metabase | ||
MB_DB_PORT: 5432 | ||
MB_DB_USER_FILE: /run/secrets/db_user | ||
MB_DB_PASS_FILE: /run/secrets/db_password | ||
MB_DB_HOST: postgres | ||
networks: | ||
- metanet1 | ||
secrets: | ||
- db_password | ||
- db_user | ||
healthcheck: | ||
test: curl --fail -I http://localhost:3000/api/health || exit 1 | ||
interval: 15s | ||
timeout: 5s | ||
retries: 5 | ||
postgres: | ||
image: postgres:latest | ||
container_name: postgres | ||
hostname: postgres | ||
environment: | ||
POSTGRES_USER_FILE: /run/secrets/db_user | ||
POSTGRES_DB: metabase | ||
POSTGRES_PASSWORD_FILE: /run/secrets/db_password | ||
networks: | ||
- metanet1 | ||
secrets: | ||
- db_password | ||
- db_user | ||
networks: | ||
metanet1: | ||
driver: bridge | ||
secrets: | ||
db_password: | ||
file: db_password.txt | ||
db_user: | ||
file: db_user.txt |