Skip to content

rixrix/dangx-project

Repository files navigation

Dangx Project

Simple Diagram

This is an attempt to build a microservices architecture: API driven, lightweight on infrastructure (Alpine Linux), loosely coupled services. See ideas from [1], [2]

Tech Stack

  • Alpine Linux
  • NodeJS
  • Nginx
  • Dnsmasq
  • Docker

Commands / HowTo

    1. For fresh project, create the special network
    • ./scripts/docker-new-network.sh
    1. Build the containers
    • ./scripts/docker-compose-up.sh
    1. Destroy the containers, excluding network and images
    • ./scripts/docker-compose-down.sh
    1. Restart the containers
    • ./scripts/docker-compose-restart.sh

Folder Structure

./
    docker/
        +- all Docker related files
    scipts/
        +- compose scripts, new network, etc
    www-api/
        +- API source code
    www-public/
        +- Landing/static page

Todo

The list below requires a massive amount of time but definitely doable.

  • Deploy to AWS
  • Build infra with Terraform
  • Use registry like Consul, etc
  • Multi-cloud deployment eg. AWS, Google Cloud, Azure
  • Use CI
  • Others, file an issue

Services

Notes

  • Dnsmasq
    • Configured to only return queries for any host under "dev" eg: xxx.dev, api.dangxproject.dev on 127.0.0.1 IP address
    • command section in docker-compose.dnsmasq.yml and its manpage
  • Docker vEthernet on Windows 10
    • Attach the following entries below to your Docker vEthernet IPv4 adapter:
      • DNS Server: 127.0.0.1
      • DNS Suffix: dev
  • Tested on Windows 10
    • Windows 10 Pro Insider Release Build: 16251.rs3_release
    • Docker Server Version: 17.06.0-ce
    • Kernel Version: 4.9.36-moby
    • Dell XPS 13 9343

References