Skip to main content

Docker Deployment Guide

✅ Step 1: Install Docker

sudo apt update
sudo apt install -y docker.io docker-compose
sudo systemctl enable docker
sudo systemctl start docker

✅ Step 2: Create docker-compose.yml

nano docker-compose.yml

Paste the following:

services:
app:
image: beyondtechitsolutions/tadreeblms:v6
ports:
- "8000:80"
depends_on:
db:
condition: service_healthy
restart: unless-stopped

db:
image: mysql:8.0
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: rootpass
MYSQL_DATABASE: tadreeblms
MYSQL_USER: tadreeb
MYSQL_PASSWORD: secret
volumes:
- dbdata:/var/lib/mysql
healthcheck:
test: ["CMD", "mysqladmin", "ping", "-h", "localhost"]
interval: 10s
timeout: 5s
retries: 12
start_period: 30s

volumes:
dbdata:

Save:

  • Press CTRL + O → Enter
  • Press CTRL + X

✅ Step 3: Run Containers

sudo docker-compose up -d

✅ Step 4: Open Port 8000 (AWS EC2)

Go to AWS EC2 → Security Groups → Inbound Rules

Add rule:

  • Type: Custom TCP
  • Port: 8000
  • Source: 0.0.0.0/0

✅ Step 5: Access Application

Open in browser:

http://<your-server-ip>:8000

✅ Step 6: Run Installer

Enter database details:

  • Host: db
  • Port: 3306
  • Database: tadreeblms
  • Username: tadreeb
  • Password: secret

🔍 Troubleshooting

Check running containers:

docker ps

Check logs:

docker-compose logs -f

Check DB logs:

docker-compose logs -f db

🧠 Notes

  • No need to clone project on server
  • No need Dockerfile on server
  • Image is pulled from Docker Hub
  • docker-compose is only used to run services

🔥 Final Flow

Install Docker → Create compose → Run → Open port → Access app → Install