MikroWizard.docker-compose-.../docker-compose.yml
sepehr a8f029ee38 feat: Initial commit 🎉
Set up the foundational structure for the MikroWizard deployment repository, including:
- Docker Compose configuration for MikroFront, MikroMan, PostgreSQL, and Redis Stack.
- `prepare.sh` script for host environment preparation.
- Database initialization script (`init-db.sql`).
- `.env` template for centralized configuration.

This commit marks the beginning of a streamlined deployment process for MikroWizard!
2024-12-16 13:45:30 +03:00

69 lines
1.6 KiB
YAML

version: '3.9'
services:
postgres:
image: postgres:latest
container_name: postgres
environment:
POSTGRES_USER: ${MW_DB_USER}
POSTGRES_PASSWORD: ${MW_DB_PASSWORD}
POSTGRES_DB: ${MW_DB_NAME}
PGUSER: ${MW_DB_USER}
volumes:
- db_data:/var/lib/postgresql/data
- ./init-db.sql:/docker-entrypoint-initdb.d/init.sql
ports:
- "5432:5432"
healthcheck:
test: [ "CMD-SHELL", "pg_isready -q -U ${MW_DB_USER} -d ${MW_DB_NAME}" ]
interval: 5s
timeout: 5s
retries: 50
redis:
image: redis/redis-stack-server:latest
ports:
- "6379:6379"
mikroman:
build:
context: ./mikroman
dockerfile: Dockerfile
network_mode: "host"
entrypoint: bash -c "cd /app && ./init.sh"
environment:
- MW_SERVER_IP=${MW_SERVER_IP}
- MW_RAD_SECRET=${MW_RAD_SECRET}
- MW_DB_PASSWORD=${MW_DB_PASSWORD}
- MW_DB_USER=${MW_DB_USER}
- MW_DB_NAME=${MW_DB_NAME}
- MW_encryptKey=${MW_encryptKey}
volumes:
- ${CONF_PATH}:/conf
- ${FIRMWARE_PATH}:/conf/firmware
- ${BACKUPS_PATH}:/conf/backups
extra_hosts:
- "host.docker.internal:host-gateway"
depends_on:
postgres:
condition: service_healthy
env_file: .env
mikrofront:
build:
context: ./mikrofront
dockerfile: Dockerfile
ports:
- "80:80"
volumes:
- ./mikrofront/nginx.conf:/etc/nginx/conf.d/default.conf
- ${CONF_PATH}:/conf
depends_on:
- mikroman
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
db_data: