Skip to content

Angular Dashboard Deployment

Overview

This guide provides detailed instructions on deploying the static Somalia dashboard Angular website. The provided docker-compose.yml file includes a service for serving the Angular application using Nginx.

Docker Compose File

version: "3.8"

services:
  somdash:
    image: michameiu/somdash:v1.0.1
    networks:
      - ovencrypt

    deploy:
      replicas: 1
      labels:
        - "traefik.enable=true"
        - "traefik.http.routers.somdash.rule=Host(`domain.com`) || Host(`dash.domain.com`)"
        - "traefik.http.services.somdash.loadbalancer.server.port=80"
        - "traefik.docker.network=ovencrypt"

networks:
  ovencrypt:
    external: true
    attachable: true

Instructions

  1. Prerequisites

    • Ensure Docker and Docker Compose are installed.
    • Configure Domains
    • Initialize Docker Swarm if not initialized: sh docker swarm init
    • Ensure the ovencrypt network is created and attachable: sh docker network create --driver=overlay --attachable ovencrypt
  2. Setup Environment Variables

    • Ensure that the Traefik labels and network configurations are correct.
  3. Deploy the Stack

    • Navigate to the directory containing the docker-compose.yml file.
    • Run the following command to deploy the stack: sh docker stack deploy -c docker-compose.yml <stack_name> Replace <stack_name> with a suitable name for your stack.
  4. Verify Deployment

    • Check the status of the services using: sh docker stack services <stack_name>
    • Verify that the somdash service is running and properly configured.
  5. Access the Website

    • The static Angular website should be accessible at http://domain.com or http://dash.domain.com.
  6. Logs and Debugging

    • To view logs for the service, use: sh docker service logs <stack_name>_somdash Replace <stack_name> with the name of your stack.