Skip to content
This repository was archived by the owner on Aug 3, 2025. It is now read-only.
Merged
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,17 @@ Questions on how to add your app to Groot or use the Groot API:
```
9. Wait for the image to build and startup. If it works, you'll be able to visit `https://0.0.0.0:5000` in a browser and see the deployed site. The Groot API will be available on port 8000.

Useful Notes:

* If you want to just rebuild one service (i.e. for dev work), you can keep the `docker-compose` command running, and run this command in a separate terminal window to rebuild the service you're working on:
```
docker-compose up -d --build SERVICE
```
* For dev work you'll probably want to run in unauthenticated mode. To do this, change the `CMD` line in `groot-api-gateway/Dockerfile` to:
```
CMD ["./build/groot-api-gateway", "-u"]
```

## License

This project is licensed under the University of Illinois/NCSA Open Source License. For a full copy of this license take a look at the LICENSE file.
Expand Down
6 changes: 5 additions & 1 deletion database_setup.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
CREATE DATABASE IF NOT EXISTS groot_caffeine_service_dev;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a separate setup for prod dbs?

Copy link
Member Author

@bcongdon bcongdon Apr 3, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we're currently running services with the _dev suffix in prod...

I guess it could be worth making the _dev and _prod databases in this script, though I'm not sure the _prod databases are enumerated anywhere.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was just following a convention of a _dev suffix for development environments and just the service name with no suffix for prod (at least for ruby services).

CREATE DATABASE IF NOT EXISTS groot_credits_service;
CREATE DATABASE IF NOT EXISTS groot_gigs_service;
CREATE DATABASE IF NOT EXISTS groot_meme_service;
CREATE DATABASE IF NOT EXISTS groot_merch_service_dev;
CREATE DATABASE IF NOT EXISTS groot_quote_service_dev;
CREATE DATABASE IF NOT EXISTS groot_recruiter_service_dev;
CREATE DATABASE IF NOT EXISTS groot_user_service_dev;
CREATE DATABASE IF NOT EXISTS groot_user_service_dev;
GRANT ALL PRIVILEGES ON *.* TO 'root'@'%';
FLUSH PRIVILEGES;
21 changes: 21 additions & 0 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
version: '2'
services:
db:
image: mysql
environment:
- MYSQL_ROOT_PASSWORD=root
volumes:
- ./database_setup.sql:/docker-entrypoint-initdb.d/schema.sql:ro
ports:
- 3306
groot:
build: .
command: /bin/bash -c "./docker_go_symlink.sh && ./dev_spinup.sh"
working_dir: /groot-deploy
volumes:
- .:/groot-deploy
ports:
- "8000:8000"
- "5000:5000"
depends_on:
- db
126 changes: 113 additions & 13 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,21 +1,121 @@
version: '2'
services:
db:
db:
image: mysql
environment:
- MYSQL_ROOT_PASSWORD=root
volumes:
- ./database_setup.sql:/docker-entrypoint-initdb.d/schema.sql:ro
- db_data:/var/lib/mysql
ports:
- 3306
groot:
build: .
command: /bin/bash -c "./docker_go_symlink.sh && ./dev_spinup.sh"
working_dir: /groot-deploy
volumes:
- .:/groot-deploy
ports:
- "8000:8000"
- "5000:5000"
depends_on:
- db
- "3306:3306"
restart: always

groot-api-gateway:
build: groot-api-gateway
ports:
- "8000:8000"
volumes:
- groot_api_gateway_volume:/var/groot-api-gateway/

restart: always

groot-credits-service:
build: groot-credits-service
ports:
- "8765:8765"
depends_on:
- db
- groot-api-gateway
restart: always

groot-desktop-frontend:
build: groot-desktop-frontend
depends_on:
- groot-api-gateway
ports:
- "5000:5000"
restart: always

groot-events-service:
build: groot-events-service
ports:
- "8002:8002"
depends_on:
- groot-api-gateway
restart: always

groot-gigs-service:
build: groot-gigs-service
ports:
- "8964:8964"
depends_on:
- db
- groot-api-gateway
restart: always

groot-groups-service:
build: groot-groups-service
ports:
- "9001:9001"
depends_on:
- groot-api-gateway
restart: always

groot-meme-service:
build: groot-meme-service
ports:
- "42069:42069"
depends_on:
- db
- groot-api-gateway
restart: always

groot-merch-service:
build: groot-merch-service
ports:
- "6969:6969"
depends_on:
- db
- groot-api-gateway
restart: always

groot-quotes-service:
build: groot-quotes-service
ports:
- "9494:9494"
depends_on:
- db
- groot-api-gateway
restart: always

groot-recruiters-service:
build: groot-recruiters-service
ports:
- "3000:3000"
depends_on:
- db
- groot-api-gateway
restart: always

groot-users-service:
build: groot-users-service
ports:
- "8001:8001"
depends_on:
- db
- groot-api-gateway
restart: always

groot-voz:
build: groot-voz
ports:
- "5652:5652"
depends_on:
- db
- groot-api-gateway
restart: always

volumes:
db_data:
groot_api_gateway_volume:
84 changes: 64 additions & 20 deletions docker_settings_init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,24 @@ credits="MYSQL = {
'dbname': 'groot_credits_service'
}

GROOT_SERVICES_URL = 'http://localhost:8000'
GROOT_SERVICES_URL = 'http://groot-api-gateway:8000'
GROOT_ACCESS_TOKEN = ''
STRIPE_SECRET_KEY = ''"
echo "$credits" > groot-credits-service/settings.py

##### SETUP GIGS #####
echo "* Setting up GIGS"
credits="MYSQL = {
'user': 'root',
'password': 'root',
'host': 'db',
'dbname': 'groot_gigs_service'
}

GROOT_SERVICES_URL = 'http://groot-api-gateway:8000'
GROOT_ACCESS_TOKEN = ''
echo "$credits" > groot-gigs-service/settings.py

##### SETUP MEMES #####
echo "* Setting up MEMES"
memes="MYSQL = {
Expand All @@ -24,67 +37,98 @@ memes="MYSQL = {
}

GROOT_ACCESS_TOKEN = ''
GROOT_SERVICES_URL = 'http://localhost:8000'"
GROOT_SERVICES_URL = 'http://groot-api-gateway:8000'"
echo "$memes" > groot-meme-service/settings.py

##### SETUP MERCH #####
echo "* Setting up MERCH"
merch_secrets="groot:
access_key: ''"
merch_database="development:
access_key: ''
host: 'http://groot-api-gateway:8000'

merch_pi:
access_key: 'INSERT_TOKEN_HERE'
ip_address: 'INSERT_IPADDRESS'

development:
user: root
password: root
hostname: db
name: groot_caffeine_service_dev"
name: groot_merch_service_dev"
echo "$merch_secrets" > groot-merch-service/config/secrets.yaml
echo "$merch_database" > groot-merch-service/config/database.yaml

##### SETUP QUOTES #####
echo "* Setting up QUOTES"
quotes_secrets="groot:
access_key: ''"
quotes_database="development:
access_key: 'GROOT_ACCESS_KEY'
host: 'http://groot-api-gateway:8000'

development:
user: root
password: root
hostname: db
name: groot_quote_service_dev"

echo "$quotes_secrets" > groot-quotes-service/config/secrets.yaml
echo "$quotes_database" > groot-quotes-service/config/database.yaml

##### SETUP RECRUITERS #####
echo "* Setting up RECRUITERS"
recruiters_secrets="groot:
access_key: ''"
recruiters_database="development:
recruiters_secrets="aws:
access_key_id: ''
secret_access_key: ''

groot:
access_key: 'INSERT_TOKEN_HERE'
host: 'http://groot-api-gateway:8000'

jwt:
secret: 'SECRET_JWT_TOKEN'

development:
user: root
password: root
hostname: db
name: groot_recruiter_service_dev"
echo "$recruiters_secrets" > groot-recruiters-service/config/secrets.yaml
echo "$recruiters_database" > groot-recruiters-service/config/database.yaml

##### SETUP USERS #####
echo "* Setting up USERS"
users_secrets="groot:
access_key: ''"
users_database="development:
access_key: 'GROOT_ACCESS_KEY'
host: 'http://groot-api-gateway:8000'

development:
user: root
password: root
hostname: db
name: groot_user_service_dev"
echo "$users_secrets" > groot-users-service/config/secrets.yaml
echo "$users_database" > groot-users-service/config/database.yaml

##### SETUP GROOT #####
echo "* Setting up GROOT"
groot_config="package config

const RecruiterToken string = \"\"
const AuthPrefix = \"Basic \"
const AuthURL string = \"http://localhost:8008\"
const AuthURL string = \"http://groot-auth-stub-service:8008\"
const AuthToken string = \"\"

const AccessLogLocation string = \"log/access.log\"
const ClientRegistryLocation string = \"clients.db\"
const AccessControlPolicy string = \"*\""
//Service hosts
const CreditsURL = \"http://groot-credits-service:8765\"
const EventsURL = \"http://groot-events-service:8002\"
const GigsURL = \"http://groot-gigs-service:8964\"
const GroupsURL = \"http://groot-groups-service:9001\"
const HardwareURL = \"http://groot:4523/api/v1.0\"
const MemesURL = \"http://groot-meme-service:42069\"
const MerchURL = \"http://groot-merch-service:6969\"
const QuotesURL = \"http://groot-quotes-service:9494\"
const RecruiterURL = \"http://groot-recruiters-service:4567\"
const UsersURL = \"http://groot-users-service:8001\"

//Arbor configurations
func LoadArborConfig() {
security.AccessLogLocation = \"/var/groot-api-gateway/access.log\"
security.ClientRegistryLocation = \"/var/groot-api-gateway/clients.db\"
proxy.AccessControlPolicy = \"*\"
}"
echo "$groot_config" > groot/config/config.go