Skip to content

Instantly share code, notes, and snippets.

@abjoseph
Last active August 15, 2022 19:11
Show Gist options
  • Save abjoseph/0fceae1f8b96b5b369449be212ea866f to your computer and use it in GitHub Desktop.
Save abjoseph/0fceae1f8b96b5b369449be212ea866f to your computer and use it in GitHub Desktop.
Hygieia Setup w/ Docker-Compose
version: '3'
services:
db:
image: mongo:latest
container_name: hygieia-db
ports:
- "27017:27017"
volumes:
- "db-data:/data/db"
api:
image: hygieia-api
container_name: hygieia-api
environment:
SPRING_DATA_MONGODB_HOST: "hygieia-db"
volumes:
- ./logs:/hygieia/logs
depends_on:
- db
ports:
- "8080:8080"
ui:
image: hygieia-ui
container_name: hygieia-ui
environment:
API_URL: "http://hygieia-api:8080"
depends_on:
- api
ports:
- "3000:80"
volumes:
db-data:
certs:

Install pre-requisites

sudo apt install maven

mkdir -p src/logs

nano ./src/docker-compose.yml #Enter the contents of the docker-compose.yml in this gist

Build docker image for UI

git clone https://github.com/hygieia/hygieia.git ./src/ui

cd ./src/ui

docker build -t hygieia-ui .

Build docker images for API

git clone https://github.com/hygieia/api.git ./src/api

cd ./src/api

mvn clean install -Dmaven.test.skip=true

docker build -t hygieia-api .

Bring up only the MongoDB container

docker-compose -p hygieia -f ./src/docker-compose.yml up -d db

docker exec -it hygieia-db mongo db/admin --eval 'db.getSiblingDB("dashboarddb").createUser({user: "dashboarduser", pwd: "dbpassword", roles: [{role: "readWrite", db: "dashboarddb"}]})'

Bring up api and ui containers

docker-compose -p hygieia -f ./src/docker-compose.yml up -d

Navigate to the signup page and create a user

http://localhost:3000/user/signup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment