Skip to content

Commit

Permalink
added default environment variables
Browse files Browse the repository at this point in the history
Signed-off-by: Gary White Jr <[email protected]>
  • Loading branch information
GaryPWhite committed Feb 15, 2024
1 parent 8fb7f5a commit ef12fcb
Show file tree
Hide file tree
Showing 7 changed files with 35 additions and 17 deletions.
9 changes: 8 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ compose-run-database:
@ echo
@ docker-compose -f docker-compose.yml -f database-compose.yml up --build

docker-build: docker-build-backend docker-build-frontend docker-build-database
docker-build: docker-build-backend docker-build-frontend docker-build-database docker-build-rabbitmq

docker-build-backend:
@ docker build -t augurlabs/augur:backend -f util/docker/backend/Dockerfile .
Expand All @@ -159,6 +159,8 @@ docker-build-frontend:
docker-build-database:
@ docker build -t augurlabs/augur:database -f util/docker/database/Dockerfile .

docker-build-rabbitmq:
@ docker build -t augurlabs/augur:rabbitmq -f util/docker/rabbitmq/Dockerfile .

docker-run-backend:
@ - docker stop augur_backend
Expand All @@ -174,3 +176,8 @@ docker-run-database:
@ - docker stop augur_database
@ - docker rm augur_database
docker run -p 5434:5432 --name augur_database augurlabs/augur:database

docker-run-rabbitmq:
@ - docker stop augur_rabbitmq
@ - docker rm augur_rabbitmq
docker run -p 5434:5432 --name augur_rabbitmq augurlabs/augur:rabbitmq
17 changes: 10 additions & 7 deletions docker-compose-externalDB.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ services:
rabbitmq:
image: augur-rabbitmq
build:
context: ./docker/rabbitmq/
dockerfile: ./docker/rabbitmq/
context: .
dockerfile: ./docker/rabbitmq/Dockerfile
# ports for amqp connections / management api
ports:
- 5671:5671
- 5672:5672
- 15671:15671
- 15672:15672
- 5671:5671
- 5672:5672
- 15671:15671
- 15672:15672
environment:
- "RABBIT_MQ_DEFAULT_USER=${AUGUR_RABBITMQ_USERNAME:-augur}"
- "RABBIT_MQ_DEFAULT_PASSWORD=${AUGUR_RABBITMQ_PASSWORD:-password123}"

augur:
image: augurlabs/augur-new:latest
Expand All @@ -38,7 +41,7 @@ services:
- "AUGUR_GITHUB_USERNAME=${AUGUR_GITHUB_USERNAME}"
- "AUGUR_GITLAB_USERNAME=${AUGUR_GITLAB_USERNAME}"
- REDIS_CONN_STRING=redis://redis:6379
- RABBITMQ_CONN_STRING=amqp://augur:password123@rabbitmq:5672/augur_vhost
- RABBITMQ_CONN_STRING=amqp://${AUGUR_RABBITMQ_USERNAME:-augur}:${AUGUR_RABBITMQ_PASSWORD:-password123}@rabbitmq:5672/augur_vhost
depends_on:
- redis

Expand Down
16 changes: 10 additions & 6 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,17 @@ services:
rabbitmq:
image: augur-rabbitmq
build:
context: ./docker/rabbitmq/
context: .
dockerfile: ./docker/rabbitmq/Dockerfile
# ports for amqp connections / management api
ports:
- 5671:5671
- 5672:5672
- 15671:15671
- 15672:15672
- 5671:5671
- 5672:5672
- 15671:15671
- 15672:15672
environment:
- "RABBIT_MQ_DEFAULT_USER=${AUGUR_RABBITMQ_USERNAME:-augur}"
- "RABBIT_MQ_DEFAULT_PASSWORD=${AUGUR_RABBITMQ_PASSWORD:-password123}"

augur:
image: augur-new:latest
Expand All @@ -50,7 +54,7 @@ services:
- "AUGUR_GITHUB_USERNAME=${AUGUR_GITHUB_USERNAME}"
- "AUGUR_GITLAB_USERNAME=${AUGUR_GITLAB_USERNAME}"
- REDIS_CONN_STRING=redis://redis:6379
- RABBITMQ_CONN_STRING=amqp://augur:password123@rabbitmq:5672/augur_vhost
- RABBITMQ_CONN_STRING=amqp://${AUGUR_RABBITMQ_USERNAME:-augur}:${AUGUR_RABBITMQ_PASSWORD:-password123}@rabbitmq:5672/augur_vhost
depends_on:
- augur-db
- redis
Expand Down
2 changes: 1 addition & 1 deletion docker/rabbitmq/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM rabbitmq:3.12-management-alpine
LABEL maintainer="574/[email protected]"
LABEL version="0.62.0"

COPY --chown=rabbitmq:rabbitmq augur.conf /etc/rabbitmq/conf.d/
COPY --chown=rabbitmq:rabbitmq ./docker/rabbitmq/augur.conf /etc/rabbitmq/conf.d/

RUN chmod 777 /etc/rabbitmq/conf.d/augur.conf

Expand Down
2 changes: 0 additions & 2 deletions docker/rabbitmq/augur.conf
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
default_vhost = augur_vhost
default_user = augur
default_pass = password123

default_permissions.configure = .*
default_permissions.read = .*
Expand Down
3 changes: 3 additions & 0 deletions scripts/docker/docker-setup-database.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ echo "AUGUR_DB_NAME=augur" >> docker_env.txt
echo "AUGUR_DB_PORT=5434" >> docker_env.txt
echo "AUGUR_DB_USER=augur" >> docker_env.txt
echo "AUGUR_DB_PASSWORD=augur" >> docker_env.txt
echo "AUGUR_RABBITMQ_USERNAME=augur" >> .env
echo "AUGUR_RABBITMQ_PASSWORD=password123" >> .env


#This checks the .env file's environment variables NOT docker_env.txt.
#AUGUR_DB_TYPE is set by the parent script in the .env file.
Expand Down
3 changes: 3 additions & 0 deletions scripts/docker/docker-setup-external.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ then
echo "AUGUR_DB_HOST=$dbHostname" >> docker_env.txt
echo "AUGUR_DB_HOST=$dbHostname" >> .env
echo "AUGUR_DB_PORT=$dbPort" >> docker_env.txt
echo "AUGUR_RABBITMQ_USERNAME=augur" >> .env
echo "AUGUR_RABBITMQ_PASSWORD=password123" >> .env


read -p "Plase input database name: " dbName
#Pretty sure these stay constant among augur databases
Expand Down

0 comments on commit ef12fcb

Please sign in to comment.