Skip to content

Commit

Permalink
fix mongo-dashboard
Browse files Browse the repository at this point in the history
  • Loading branch information
khanzadimahdi committed Jan 16, 2025
1 parent d6452b0 commit a8650f8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 12 deletions.
1 change: 0 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ export MONGO_PASSWORD = test‍

export DASHBOARD_MONGO_USERNAME = username
export DASHBOARD_MONGO_PASSWORD = password
export DASHBOARD_MONGO_MONGODB_URL = mongodb://${MONGO_USERNAME}:${MONGO_PASSWORD}@mongodb:27017

export PROXY_IMAGE = ghcr.io/tarhche/proxy:latest

Expand Down
8 changes: 4 additions & 4 deletions compose.mongodb.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
mongodb:
image: mongo:8.0
image: mongodb/mongodb-community-server:8.0-ubi9
networks:
- mongodb
deploy:
Expand All @@ -13,11 +13,11 @@ services:
max_attempts: 3
resources:
limits:
cpus: '0.50'
cpus: '1'
memory: 200M
environment:
MONGO_INITDB_ROOT_USERNAME: ${MONGO_USERNAME}
MONGO_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}
MONGODB_INITDB_ROOT_USERNAME: ${MONGO_USERNAME}
MONGODB_INITDB_ROOT_PASSWORD: ${MONGO_PASSWORD}
volumes:
- ${VOLUME_PATH}/mongodb/db:/data/db
- ${VOLUME_PATH}/mongodb/configdb:/data/configdb
Expand Down
7 changes: 5 additions & 2 deletions compose.mongodb_dashboard.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
mongodb_dashboard:
image: mongo-express
image: mongo-express:1-20-alpine3.19
networks:
- mongodb
- mongodb_dashboard
Expand All @@ -17,9 +17,12 @@ services:
cpus: '0.20'
memory: 150M
environment:
ME_CONFIG_MONGODB_SERVER: mongodb
ME_CONFIG_MONGODB_PORT: 27017
ME_CONFIG_BASICAUTH_USERNAME: ${DASHBOARD_MONGO_USERNAME}
ME_CONFIG_BASICAUTH_PASSWORD: ${DASHBOARD_MONGO_PASSWORD}
ME_CONFIG_MONGODB_URL: ${DASHBOARD_MONGO_MONGODB_URL}
ME_CONFIG_MONGODB_ADMINUSERNAME: ${MONGO_USERNAME}
ME_CONFIG_MONGODB_ADMINPASSWORD: ${MONGO_PASSWORD}

networks:
mongodb_dashboard:
Expand Down
11 changes: 6 additions & 5 deletions resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ resource "aws_volume_attachment" "backend" {

import {
to = aws_instance.backend
id = "i-06d3dcfc254a1de52"
id = "i-012d486e2004812bd"
}

resource "aws_instance" "backend" {
Expand All @@ -98,11 +98,11 @@ resource "aws_instance" "backend" {
user_data = <<-EOT
#!/bin/bash
# volumes
sudo mkfs.ext4 /dev/xvdf
# volumes - ec2 modifies the device name xvdf to nvme1n1
sudo mkfs.ext4 /dev/nvme1n1
sudo mkdir /volume_01
sudo mount /dev/xvdf /volume_01
sudo echo "/dev/xvdf /volume_01 ext4 defaults,nofail 0 0" | sudo tee -a /etc/fstab
sudo mount /dev/nvme1n1 /volume_01
sudo echo "/dev/nvme1n1 /volume_01 ext4 defaults,nofail 0 0" | sudo tee -a /etc/fstab
# tools
sudo apt install -y wget python3 ca-certificates curl htop jq vim make
Expand Down Expand Up @@ -225,6 +225,7 @@ resource "aws_lb_target_group" "http" {
}

# can't be imported, that's why the below lines are commented
# - if it's the first time you create the ec2, uncomment the below code
# resource "aws_lb_target_group_attachment" "backend_http" {
# target_group_arn = aws_lb_target_group.http.arn
# target_id = aws_instance.backend.id
Expand Down

0 comments on commit a8650f8

Please sign in to comment.