-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Implement basic structure ant services.
- Loading branch information
Showing
8 changed files
with
232 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This file is part of the Drups.io Docker. | ||
# | ||
# (c) 2021 Drups.io <[email protected]> | ||
# | ||
# For the full copyright and license information, please view the LICENSE | ||
# file that was distributed with this source code. | ||
# | ||
# Written by Temuri Takalandze <[email protected]>, April 2021 | ||
|
||
### PROJECT SETTINGS | ||
|
||
PROJECT_NAME=drups | ||
|
||
### URLS | ||
|
||
PROJECT_BASE_URL=${PROJECT_NAME}.localhost | ||
RABBITMQ_URL=rabbitmq.${PROJECT_BASE_URL} | ||
TRAEFIK_URL=${PROJECT_BASE_URL}:8080 | ||
|
||
### CREDENTIALS | ||
|
||
RABBITMQ_USER=guest | ||
RABBITMQ_PASS=guest | ||
|
||
### SERVICE VERSION TAGS | ||
|
||
REDIS_TAG=6.2 | ||
RABBITMQ_TAG=3.8-management |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
# This file is part of the Drups.io Docker. | ||
# | ||
# (c) 2021 Drups.io <[email protected]> | ||
# | ||
# For the full copyright and license information, please view the LICENSE | ||
# file that was distributed with this source code. | ||
# | ||
# Written by Temuri Takalandze <[email protected]>, April 2021 | ||
|
||
include .env | ||
|
||
default: help | ||
|
||
## help : Print commands help. | ||
.PHONY: help | ||
help : Makefile | ||
@sed -n 's/^##//p' $< | ||
|
||
## up : Start up containers. | ||
.PHONY: up | ||
up: | ||
@echo "Starting up containers for $(PROJECT_NAME)..." | ||
docker-compose pull | ||
docker-compose up -d --remove-orphans | ||
@make info | ||
|
||
## down : Stop containers. | ||
.PHONY: down | ||
down: stop | ||
|
||
## start : Start containers without updating. | ||
.PHONY: start | ||
start: | ||
@echo "Starting containers for $(PROJECT_NAME) from where you left off..." | ||
@docker-compose start | ||
@make info | ||
|
||
## stop : Stop containers. | ||
.PHONY: stop | ||
stop: | ||
@echo "Stopping containers for $(PROJECT_NAME)..." | ||
@docker-compose stop | ||
|
||
## prune : Remove containers and their volumes. | ||
## You can optionally pass an argument with the service name to prune single container | ||
## prune engine : Prune `engine` container and remove its volumes. | ||
## prune engine application : Prune `engine` and `application` containers and remove their volumes. | ||
.PHONY: prune | ||
prune: | ||
@echo "Removing containers for $(PROJECT_NAME)..." | ||
@docker-compose down -v $(filter-out $@,$(MAKECMDGOALS)) | ||
|
||
## ps : List running containers. | ||
.PHONY: ps | ||
ps: | ||
@docker ps --filter name='$(PROJECT_NAME)*' | ||
|
||
## info : Print stack info. | ||
.PHONY: info | ||
info: | ||
@./scripts/info.sh | ||
|
||
## shell : Access `engine` container via shell. | ||
## You can optionally pass an argument with a service name to open a shell on the specified container | ||
.PHONY: shell | ||
shell: | ||
docker exec -ti -e COLUMNS=$(shell tput cols) -e LINES=$(shell tput lines) $(shell docker ps --filter name='$(PROJECT_NAME)_$(or $(filter-out $@,$(MAKECMDGOALS)), 'engine')' --format "{{ .ID }}") sh | ||
|
||
## logs : View containers logs. | ||
## You can optinally pass an argument with the service name to limit logs | ||
## logs engine : View `engine` container logs. | ||
## logs engine application : View `engine` and `application` containers logs. | ||
.PHONY: logs | ||
logs: | ||
@docker-compose logs -f $(filter-out $@,$(MAKECMDGOALS)) | ||
|
||
# https://stackoverflow.com/a/6273809/1826109 | ||
%: | ||
@: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
engine/ | ||
application/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# This file is part of the Drups.io Docker. | ||
# | ||
# (c) 2021 Drups.io <[email protected]> | ||
# | ||
# For the full copyright and license information, please view the LICENSE | ||
# file that was distributed with this source code. | ||
# | ||
# Written by Temuri Takalandze <[email protected]>, April 2021 | ||
|
||
version: "3.7" | ||
|
||
services: | ||
rabbitmq: | ||
image: rabbitmq:$RABBITMQ_TAG | ||
container_name: "${PROJECT_NAME}_rabbitmq" | ||
environment: | ||
RABBITMQ_DEFAULT_USER: $RABBITMQ_USER | ||
RABBITMQ_DEFAULT_PASS: $RABBITMQ_PASS | ||
labels: | ||
- "traefik.http.services.${PROJECT_NAME}_rabbitmq_management_ui.loadbalancer.server.port=15672" | ||
- "traefik.http.routers.${PROJECT_NAME}_rabbitmq_management_ui.rule=Host(`${RABBITMQ_URL}`)" | ||
|
||
redis: | ||
image: redis:$REDIS_TAG | ||
container_name: "${PROJECT_NAME}_redis" | ||
|
||
traefik: | ||
image: traefik:v2.0 | ||
container_name: "${PROJECT_NAME}_traefik" | ||
command: --api.insecure=true --providers.docker | ||
ports: | ||
- '80:80' | ||
- '8080:8080' | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# This file is part of the Drups.io Docker. | ||
# | ||
# (c) 2021 Drups.io <[email protected]> | ||
# | ||
# For the full copyright and license information, please view the LICENSE | ||
# file that was distributed with this source code. | ||
# | ||
# Written by Temuri Takalandze <[email protected]>, April 2021 | ||
|
||
version: "2" | ||
|
||
syncs: | ||
docker-sync-engine: | ||
src: './apps/engine' | ||
sync_userid: '501' | ||
sync_excludes: ['.gitignore', '.git/', '.idea/'] | ||
docker-sync-application: | ||
src: './apps/application' | ||
sync_userid: '501' | ||
sync_excludes: ['.gitignore', '.git/', '.idea/'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
# This file is part of the Drups.io Docker. | ||
# | ||
# (c) 2021 Drups.io <[email protected]> | ||
# | ||
# For the full copyright and license information, please view the LICENSE | ||
# file that was distributed with this source code. | ||
# | ||
# Written by Temuri Takalandze <[email protected]>, April 2021 | ||
|
||
|
||
DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
|
||
source "${DIR}"/../.env | ||
source "${DIR}"/styles.env | ||
|
||
echo -e "\n\ | ||
${COLOR_BLUE}${PROJECT_NAME} is ready!${COLOR_NONE}\v\ | ||
${COLOR_GREEN}\n RabbitMQ UI${COLOR_NONE}\t - ${COLOR_GREEN}http://${RABBITMQ_URL}${COLOR_NONE}\ | ||
${COLOR_GREEN}\n Traefik${COLOR_NONE}\t - ${COLOR_GREEN}http://${TRAEFIK_URL}${COLOR_NONE}\ | ||
${COLOR_BLUE}\n\vCredentials${COLOR_NONE}\ | ||
${COLOR_BLUE}\nRabbitMQ${COLOR_NONE}\ | ||
${COLOR_GREEN}\n Username\t${COLOR_NONE} - ${COLOR_GREEN}${RABBITMQ_USER}${COLOR_NONE}\ | ||
${COLOR_GREEN}\n Password\t${COLOR_NONE} - ${COLOR_GREEN}${RABBITMQ_PASS}${COLOR_NONE}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This file is part of the Drups.io Docker. | ||
# | ||
# (c) 2021 Drups.io <[email protected]> | ||
# | ||
# For the full copyright and license information, please view the LICENSE | ||
# file that was distributed with this source code. | ||
# | ||
# Written by Temuri Takalandze <[email protected]>, April 2021 | ||
|
||
### COLORS | ||
|
||
COLOR_NONE='\033[00m' | ||
COLOR_GREEN='\033[01;32m' | ||
COLOR_BLUE='\033[1;36m' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# This file is part of the Drups.io Docker. | ||
# | ||
# (c) 2021 Drups.io <[email protected]> | ||
# | ||
# For the full copyright and license information, please view the LICENSE | ||
# file that was distributed with this source code. | ||
# | ||
# Written by Temuri Takalandze <[email protected]>, April 2021 | ||
|
||
version: '3' | ||
|
||
services: | ||
traefik: | ||
image: traefik:v2.0 | ||
command: --api.insecure=true --providers.docker | ||
networks: | ||
- drups | ||
ports: | ||
- '80:80' | ||
- '8080:8080' | ||
volumes: | ||
- /var/run/docker.sock:/var/run/docker.sock | ||
|
||
networks: | ||
drups: | ||
external: | ||
name: project1-dir_default |