mikrofront | ||
mikroman | ||
.env | ||
docker-compose.yml | ||
init-db.sql | ||
LICENSE.txt | ||
prepare.sh | ||
README.md |
MikroWizard Deployment
This repository provides a full Docker-based setup for deploying MikroWizard services, including MikroMan (backend) and MikroFront (frontend), along with the necessary database and Redis stack.
Repository Structure
├── mikrofront/ # MikroFront service files
├── mikroman/ # MikroMan service files
├── docker-compose.yml # Main Docker Compose file
├── init-db.sql # Database initialization script
├── prepare.sh # Script to prepare host machine
├── .env # Configuration file for environment variables
Prerequisites
- Docker: Ensure Docker is installed on your machine.
- Installation guide: Docker Documentation
- Docker Compose: Ensure Docker Compose is installed.
- Installation guide: Docker Compose Documentation
Setup Instructions
Step 1: Clone the Repository
git clone https://github.com/MikroWizard/docker-compose-deployment.git mikrowizard
cd mikrowizard
Step 2: Configure Environment Variables
Edit the .env
file to set the appropriate values for your environment:
DB_NAME=mikrowizard
DB_USER=postgres
DB_PASSWORD=your_password
DB_HOST=host.docker.internal
SERVER_IP=127.0.0.1
RAD_SECRET=mysecret
Ensure you replace your_password
and other placeholders with actual values.
Step 3: Prepare Host Machine
Run the prepare.sh
script to create required directories and files:
chmod +x prepare.sh
./prepare.sh
This script will:
- Create the
conf
,firmware
, andbackups
folders on the host machine. - Ensure proper permissions.
- Create the needed configuration Files
Download Latest release of frontend and extract its content to mikrofront/dist
folder
Find latest release from following url:
https://github.com/MikroWizard/mikrofront/releases
cd mikrofront/dist/
wget https://github.com/MikroWizard/mikrofront/releases/download/1.0.2-stable/mikrofront-1.0.2.tar.gz
tar xvzf mikrofront*.tar.gz
- To verify the contents make sure there is a
html
folder insidemikrofront/dist
folder with lots of html,js files
Step 4: Start the Services
Use Docker Compose to build and start the services:
docker compose up --build
This command will:
- Build the Docker images for MikroMan and MikroFront.
- Start the PostgreSQL database, Redis stack, and MikroWizard services.
Step 5: Access the Application
- Frontend: Open http://localhost in your browser.
- Backend: Accessible through configured API endpoints.
Database Initialization
- The database is initialized automatically using the
init-db.sql
script during container startup. - Ensure the database extensions and migrations are applied:
- UUID extension is enabled.
dbmigrate.py
script creates required tables.
Customization
Environment Variables
All environment variables are centralized in the .env
file. Update these values to customize your deployment.
Volume Mapping
Host directories conf
, firmware
, and backups
are mapped to container paths:
conf
: Configuration files.firmware
: Stores firmware files.backups
: Stores database and system backups.
Troubleshooting
Common Issues
- Database Connection Errors:
- Verify the
DB_HOST
in.env
points tohost.docker.internal
or the appropriate host leave it 127.0.0.1 for default installation.
- Verify the
- Permission Denied:
- Ensure you have execution permissions for
prepare.sh
.
- Ensure you have execution permissions for
Logs
Check logs for debugging:
docker-compose logs -f
Contributions
Contributions are welcome! Submit issues or pull requests to improve the deployment process.
License
This repository is licensed under the MIT License.
Contact
For any inquiries, contact the MikroWizard team at info@mikrowizard.com.