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 36f56d4
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 13 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
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
21 changes: 11 additions & 10 deletions resources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,23 @@ resource "aws_volume_attachment" "backend" {

import {
to = aws_instance.backend
id = "i-06d3dcfc254a1de52"
id = "i-0e901470df299a6e7"
}

resource "aws_instance" "backend" {
ami = "ami-02d9d83052ced9fdd" # Canonical, Ubuntu, 24.04, arm noble image
instance_type = "t4g.small"
ami = "ami-07eef52105e8a2059" # Canonical, Ubuntu, 24.04, amd64 noble image
instance_type = "t3.medium"
key_name = "backend"
availability_zone = "eu-central-1b"

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 All @@ -121,9 +121,9 @@ resource "aws_instance" "backend" {
# install docker and sysbox
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
wget https://downloads.nestybox.com/sysbox/releases/v0.6.6/sysbox-ce_0.6.6-0.linux_arm64.deb
sudo apt install -y ./sysbox-ce_0.6.6-0.linux_arm64.deb
rm ./sysbox-ce_0.6.6-0.linux_arm64.deb
wget -O sysbox.deb https://downloads.nestybox.com/sysbox/releases/v0.6.6/sysbox-ce_0.6.6-0.linux_amd64.deb
sudo apt install -y ./sysbox.deb
rm ./sysbox.deb
# setup
sudo systemctl enable docker.service
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 36f56d4

Please sign in to comment.