diff --git a/Makefile b/Makefile index 26cac178b5..b69f688226 100644 --- a/Makefile +++ b/Makefile @@ -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 . @@ -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 @@ -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 \ No newline at end of file diff --git a/docker-compose-externalDB.yml b/docker-compose-externalDB.yml index 2fb4016d60..dedcf1089e 100644 --- a/docker-compose-externalDB.yml +++ b/docker-compose-externalDB.yml @@ -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 @@ -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 diff --git a/docker-compose.yml b/docker-compose.yml index 4abea682be..2d86a52046 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -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 @@ -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 diff --git a/docker/rabbitmq/Dockerfile b/docker/rabbitmq/Dockerfile index 06a13a24f9..cef51f28be 100644 --- a/docker/rabbitmq/Dockerfile +++ b/docker/rabbitmq/Dockerfile @@ -3,7 +3,7 @@ FROM rabbitmq:3.12-management-alpine LABEL maintainer="574/augur@simplelogin.com" 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 diff --git a/docker/rabbitmq/augur.conf b/docker/rabbitmq/augur.conf index 93c036426f..d4de989deb 100644 --- a/docker/rabbitmq/augur.conf +++ b/docker/rabbitmq/augur.conf @@ -1,6 +1,4 @@ default_vhost = augur_vhost -default_user = augur -default_pass = password123 default_permissions.configure = .* default_permissions.read = .* diff --git a/scripts/docker/docker-setup-database.sh b/scripts/docker/docker-setup-database.sh index a3eed32638..62c7aaf176 100755 --- a/scripts/docker/docker-setup-database.sh +++ b/scripts/docker/docker-setup-database.sh @@ -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. diff --git a/scripts/docker/docker-setup-external.sh b/scripts/docker/docker-setup-external.sh index db6c910c6f..8454382f75 100755 --- a/scripts/docker/docker-setup-external.sh +++ b/scripts/docker/docker-setup-external.sh @@ -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