Skip to content

fistralpro/aardvark

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

aardvark

Intro

Main location for a project that aims to create a product that helps connect people with common interests near me so I can make connections wherever I am.

Wiki contains information for the product This repo contains the files needed to construct the application from many repo's

Expected structure of your code (tree -L2) - example repos aardvark, repo_1, repo_2 . ├── aardvark │ ├── README.md │ ├── docker-compose.yml │ ├── pg_data │ ├── sample │ └── tests ├── my_repo_1 │ ├── sub_folder │ └── README.md └── my_repo_2 └── README.md

git submodules encourage tight-coupling, hence this structure

Pre-requisite

This has only been tested on a dev machine that is setup in the guide here

First Run

Clone this repo into your linux environment

Bring up all the docker containers required to run the application docker compose up -d

or add them to a swarm Deploy the web apps image (defined in the docker-compose file) to the registry
docker compose push

Now we can deploy the stack to the swarm
docker stack deploy --compose-file docker-compose.yml aardvark

check it is running
docker stack services aardvark

note - while working from the swarm, localhost from windows no longer works; you will need to connect to the eth0 network
To find the eth0:
ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1

Clean up

Remove swarm
docker stack rm aardvark
or scale individual service to 0
docker service update --replicas 0 aardvark_postgis docker service update --replicas 0 aardvark_tomcat

or (docker compose) docker compose down

docker volume rm aardvark_pg_data

Delete volumes
docker volume prune

Delete logs
?

Architecture

swarm

In windows you may need to connect by ip address (replace localhost) ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1

host Service Purpose
localhost:5432 PostGIS Data storage
localhost:5672 RabbitMQ Messaging bus
localhost:15672 RabbitMQ Messaging bus GUI
localhost:8080 Nginx Load balancer for both frontend servers
localhost:80 Nginx Frontend server 1
localhost:80 Nginx Frontend server 2
localhost:? Keycloak Identity and Access Management
localhost ? ?

Checking infrastructure

need a quick test here that all infrastructure is working prior to push let's start with a quick script that just does a docker up

all the things

postgis

Connect to db using your favourite client

rabbitmq notes

We can see whether rabbit is up and if any vhosts have been created with
curl -i -u guest:guest http://localhost:15672/api/vhosts

nginx

Nginx has been setup as a load balancer and two servers... TODO - sort out other things

docker volumes

docker volume ls

docker volume inspect aardvark_tc_app

TODO

Backup DB Env Variable Logging HTTPS Pipeline

notes

Ubuntu doesn't have a root, so instead of su - sudo su

Interactive shell into container docker exec -it [id] sh

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages