play stack one by one
This commit is contained in:
@@ -1,2 +1,5 @@
|
||||
DOCKER_MACHINE=${DOCKER_MACHINE}
|
||||
DOCKER_SOCKET_LOCATION=${DOCKER_SOCKET_LOCATION}
|
||||
DOCKER_SYSTEM=${DOCKER_SYSTEM}
|
||||
DOMAIN=${DOMAIN}
|
||||
STACK=${STACK}
|
||||
|
||||
+4
-2
@@ -5,7 +5,8 @@
|
||||
# on local host
|
||||
.PHONY: build-env
|
||||
build-env: SERVICE ?= $(DOCKER_SERVICE)
|
||||
build-env: bootstrap
|
||||
build-env: APP_NAME := $(subst _,,$(subst -,,$(subst .,,$(call LOWERCASE,$(firstword $(subst /, ,$(STACK)))))))
|
||||
build-env: bootstrap stack
|
||||
$(call docker-compose-exec-sh,$(SERVICE), \
|
||||
rm -f .env \
|
||||
&& make .env ENV=$(ENV) \
|
||||
@@ -25,7 +26,8 @@ build-init:
|
||||
# on local host
|
||||
.PHONY: build-shared
|
||||
build-shared: SERVICE ?= $(DOCKER_SERVICE)
|
||||
build-shared: bootstrap
|
||||
build-shared: APP_NAME := $(subst _,,$(subst -,,$(subst .,,$(call LOWERCASE,$(firstword $(subst /, ,$(STACK)))))))
|
||||
build-shared: bootstrap stack
|
||||
$(call docker-compose-exec-sh,$(SERVICE), \
|
||||
mkdir -p /$(notdir $(SHARED)) \
|
||||
&& $(foreach folder,$(SHARED_FOLDERS), \
|
||||
|
||||
+22
-18
@@ -32,7 +32,7 @@ bootstrap-stack: docker-network debug-STACK $(foreach stack,$(STACK),bootstrap-s
|
||||
# target build: Build application docker images to run
|
||||
# on local host
|
||||
.PHONY: build
|
||||
build: docker-compose-build ## Build application docker images
|
||||
build: docker-stack-build ## Build application docker images
|
||||
|
||||
# target build@%: Build application docker images of % ENV
|
||||
# on local host
|
||||
@@ -50,22 +50,24 @@ build@%: myos-user
|
||||
# target clean: Clean application and docker images
|
||||
# on local host
|
||||
.PHONY: clean app-clean
|
||||
clean: app-clean docker-rm docker-images-rm docker-volume-rm .env-clean ## Clean application and docker stuffs
|
||||
clean: DOCKER_COMPOSE_DOWN_OPTIONS += --rmi all --volumes
|
||||
clean: app-clean docker-stack-down $(foreach stack,$(STACK),docker-image-rm-$(STACK)) .env-clean ## Clean application and docker stuffs
|
||||
|
||||
# target clean@%: Clean deployed application and docker images of % ENV
|
||||
# on local host
|
||||
.PHONY: clean@%
|
||||
clean@%: docker-rm docker-image-rm docker-volume-rm;
|
||||
clean@%: DOCKER_COMPOSE_DOWN_OPTIONS += --rmi all --volumes
|
||||
clean@%: docker-stack-down;
|
||||
|
||||
# target config: View application docker compose file
|
||||
# on local host
|
||||
.PHONY: config
|
||||
config: docker-compose-config ## View application docker compose file
|
||||
config: docker-stack-config ## View application docker compose file
|
||||
|
||||
# target connect: Connect to docker SERVICE
|
||||
# on local host
|
||||
.PHONY: connect
|
||||
connect: docker-compose-connect ## Connect to docker SERVICE
|
||||
connect: docker-stack-connect ## Connect to docker SERVICE
|
||||
|
||||
# target connect@%: Connect to docker SERVICE of % ENV
|
||||
# on first remote host
|
||||
@@ -81,13 +83,14 @@ deploy: $(if $(filter $(ENV),$(ENV_DEPLOY)),deploy-localhost,deploy@$(ENV)) ## D
|
||||
# target down: Remove application dockers
|
||||
# on local host
|
||||
.PHONY: down
|
||||
down: docker-compose-down ufw-delete ## Remove application dockers
|
||||
down: docker-stack-down ufw-delete ## Remove application dockers
|
||||
|
||||
# target exec: Exec ARGS in docker SERVICE
|
||||
# on local host
|
||||
.PHONY: exec
|
||||
exec: SERVICE ?= $(DOCKER_SERVICE)
|
||||
exec: ## Exec command in docker SERVICE
|
||||
exec: APP_NAME := $(subst _,,$(subst -,,$(subst .,,$(call LOWERCASE,$(firstword $(subst /, ,$(STACK)))))))
|
||||
exec: stack ## Exec command in docker SERVICE
|
||||
#ifneq (,$(filter $(ENV),$(ENV_DEPLOY)))
|
||||
# $(RUN) $(call exec,$(ARGS))
|
||||
#else
|
||||
@@ -98,7 +101,7 @@ exec: ## Exec command in docker SERVICE
|
||||
# on all remote hosts
|
||||
.PHONY: exec@%
|
||||
exec@%: SERVICE ?= $(DOCKER_SERVICE)
|
||||
exec@%:
|
||||
exec@%: stack
|
||||
$(call make,ssh-exec,$(MYOS),APP ARGS SERVICE)
|
||||
|
||||
# target force-%: Fire targets %, stack-user-% and stack-host-%
|
||||
@@ -114,17 +117,17 @@ install: bootstrap app-install ## Install application
|
||||
# target logs: Display application dockers logs
|
||||
# on local host
|
||||
.PHONY: logs
|
||||
logs: docker-compose-logs ## Display application dockers logs
|
||||
logs: docker-stack-logs ## Display application dockers logs
|
||||
|
||||
# target ps: List application dockers
|
||||
# on local host
|
||||
.PHONY: ps
|
||||
ps: docker-compose-ps ## List application dockers
|
||||
ps: docker-stack-ps ## List application dockers
|
||||
|
||||
# target rebuild: Rebuild application docker images
|
||||
# on local host
|
||||
.PHONY: rebuild
|
||||
rebuild: docker-compose-rebuild ## Rebuild application dockers images
|
||||
rebuild: docker-stack-rebuild ## Rebuild application dockers images
|
||||
|
||||
# target rebuild@%: Rebuild application docker images
|
||||
# on local host
|
||||
@@ -135,7 +138,7 @@ rebuild@%:
|
||||
# target recreate: Recreate application dockers
|
||||
# on local host
|
||||
.PHONY: recreate
|
||||
recreate: docker-compose-recreate app-start ## Recreate application dockers
|
||||
recreate: docker-stack-recreate app-start ## Recreate application dockers
|
||||
|
||||
# target reinstall: Fire clean, Call .env target, Call install target
|
||||
# on local host
|
||||
@@ -151,13 +154,14 @@ release: release-create ## Create release VERSION
|
||||
# target restart: Restart application dockers
|
||||
# on local host
|
||||
.PHONY: restart
|
||||
restart: docker-compose-restart app-start ## Restart application
|
||||
restart: docker-stack-restart app-start ## Restart application
|
||||
|
||||
# target run: Run command ARGS in a new docker SERVICE
|
||||
# on local host
|
||||
.PHONY: run
|
||||
run: SERVICE ?= $(or $(DOCKER_COMPOSE_SERVICE),$(DOCKER_SERVICE))
|
||||
run: ## Run a command in a new docker
|
||||
run: APP_NAME := $(subst _,,$(subst -,,$(subst .,,$(call LOWERCASE,$(firstword $(subst /, ,$(STACK)))))))
|
||||
run: stack ## Run a command in a new docker
|
||||
#ifneq (,$(filter $(ENV),$(ENV_DEPLOY)))
|
||||
# $(call run,$(ARGS))
|
||||
#else
|
||||
@@ -175,7 +179,7 @@ run@%:
|
||||
# target scale: Scale SERVICE application to NUM dockers
|
||||
# on local host
|
||||
.PHONY: scale
|
||||
scale: docker-compose-scale ## Scale SERVICE application to NUM dockers
|
||||
scale: docker-stack-scale ## Scale SERVICE application to NUM dockers
|
||||
|
||||
# target shutdown: remove application, host and user dockers
|
||||
# on local host
|
||||
@@ -212,12 +216,12 @@ stack-%:
|
||||
# target start app-start: Start application dockers
|
||||
# on local host
|
||||
.PHONY: start app-start
|
||||
start: docker-compose-start ## Start application dockers
|
||||
start: docker-stack-start ## Start application dockers
|
||||
|
||||
# target stop: Stop application dockers
|
||||
# on local host
|
||||
.PHONY: stop
|
||||
stop: docker-compose-stop ## Stop application dockers
|
||||
stop: docker-stack-stop ## Stop application dockers
|
||||
|
||||
# target tests app-tests: Test application
|
||||
# on local host
|
||||
@@ -227,7 +231,7 @@ tests: app-tests ## Test application
|
||||
# target up: Create and start application dockers
|
||||
# on local host
|
||||
.PHONY: up
|
||||
up: docker-compose-up ufw-update app-start ## Create application dockers
|
||||
up: docker-stack-up ufw-update app-start ## Create application dockers
|
||||
|
||||
# target update app-update: Update application files
|
||||
# on local host
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
COMPOSE_FILE_DEBUG ?= $(if $(DEBUG),true)
|
||||
COMPOSE_FILE_DNS ?= false
|
||||
COMPOSE_FILE_HOME ?= false
|
||||
COMPOSE_FILE_LABELS ?= true
|
||||
COMPOSE_FILE_NETWORKS ?= true
|
||||
COMPOSE_FILE_NFS ?= $(MOUNT_NFS)
|
||||
COMPOSE_FILE_SSH ?= true
|
||||
ifneq ($(SUBREPO),)
|
||||
@@ -8,7 +10,8 @@ COMPOSE_FILE_SUBREPO ?= true
|
||||
else
|
||||
COMPOSE_FILE_APP ?= true
|
||||
endif
|
||||
COMPOSE_FILE_SUFFIX ?= $(foreach suffix,$(call LOWERCASE,$(filter-out SUFFIX,$(patsubst COMPOSE_FILE_%,%,$(filter COMPOSE_FILE_%,$(MAKE_FILE_VARS))))),$(if $(filter-out false False FALSE,$(COMPOSE_FILE_$(call UPPERCASE,$(suffix)))),$(suffix)))
|
||||
COMPOSE_FILE_SUFFIX ?= $(foreach suffix,$(call LOWERCASE,$(filter-out SUFFIX,$(patsubst COMPOSE_FILE_%,%,$(filter COMPOSE_FILE_%,$(MAKE_CMD_VARS) $(MAKE_ENV_VARS) $(MAKE_FILE_VARS))))),$(if $(filter-out false False FALSE,$(COMPOSE_FILE_$(call UPPERCASE,$(suffix)))),$(suffix) $(foreach service,$(filter-out true True TRUE,$(COMPOSE_FILE_$(call UPPERCASE,$(suffix)))),$(suffix).$(service))))
|
||||
COMPOSE_FILE_VOLUMES ?= true
|
||||
COMPOSE_FILE_WWW ?= false
|
||||
COMPOSE_IGNORE_ORPHANS ?= false
|
||||
COMPOSE_PROJECT_NAME ?= $(if $(DOCKER_COMPOSE_PROJECT_NAME),$(DOCKER_COMPOSE_PROJECT_NAME),$(subst .,,$(call LOWERCASE,$(USER)-$(APP_NAME)-$(ENV)$(addprefix -,$(subst /,,$(subst -,,$(APP_PATH)))))))
|
||||
@@ -16,6 +19,7 @@ COMPOSE_SERVICE_NAME ?= $(if $(DOCKER_COMPOSE_SERVICE_NAME),$(DOCKER_
|
||||
COMPOSE_VERSION ?= 2.24.4
|
||||
CONTEXT += COMPOSE_FILE DOCKER_REPOSITORY
|
||||
CONTEXT_DEBUG += DOCKER_BUILD_TARGET DOCKER_COMPOSE_PROJECT_NAME DOCKER_IMAGE_TAG DOCKER_REGISTRY DOCKER_SERVICE DOCKER_SERVICES
|
||||
DOCKER_ARGS ?= --log-level=$(LOG_LEVEL)
|
||||
DOCKER_AUTHOR ?= $(DOCKER_AUTHOR_NAME) <$(DOCKER_AUTHOR_EMAIL)>
|
||||
DOCKER_AUTHOR_EMAIL ?= $(subst +git,+docker,$(GIT_AUTHOR_EMAIL))
|
||||
DOCKER_AUTHOR_NAME ?= $(GIT_AUTHOR_NAME)
|
||||
@@ -27,7 +31,7 @@ DOCKER_BUILD_TARGET ?= $(if $(filter $(ENV),$(DOCKER_BUILD_TARGETS))
|
||||
DOCKER_BUILD_TARGET_DEFAULT ?= master
|
||||
DOCKER_BUILD_TARGETS ?= $(ENV_DEPLOY)
|
||||
DOCKER_BUILD_VARS ?= APP BRANCH COMPOSE_VERSION DOCKER_GID DOCKER_MACHINE DOCKER_REPOSITORY DOCKER_SYSTEM GIT_AUTHOR_EMAIL GIT_AUTHOR_NAME SSH_REMOTE_HOSTS USER VERSION
|
||||
DOCKER_COMPOSE ?= $(or $(shell $(call verle,$(COMPOSE_VERSION),$(shell docker compose version --short 2>/dev/null)) && printf 'docker compose\n'),$(shell $(call verle,$(COMPOSE_VERSION),$(shell docker-compose version --short 2>/dev/null)) && printf 'docker-compose\n'))
|
||||
DOCKER_COMPOSE ?= $(or $(shell $(call verle,$(COMPOSE_VERSION),$(shell docker compose version --short 2>/dev/null)) && printf 'docker $(DOCKER_ARGS) compose\n'),$(shell $(call verle,$(COMPOSE_VERSION),$(shell docker-compose version --short 2>/dev/null)) && printf 'docker-compose\n'))
|
||||
DOCKER_COMPOSE_ARGS ?= --ansi=auto
|
||||
DOCKER_COMPOSE_DOWN_OPTIONS ?=
|
||||
DOCKER_COMPOSE_FILE ?= docker-compose
|
||||
@@ -38,7 +42,7 @@ DOCKER_COMPOSE_RUN_OPTIONS ?= --rm $(DOCKER_COMPOSE_RUN_ENTRYPOINT) $(DOCKE
|
||||
DOCKER_COMPOSE_RUN_WORKDIR ?= $(if $(DOCKER_COMPOSE_WORKDIR),-w $(DOCKER_COMPOSE_WORKDIR))
|
||||
DOCKER_COMPOSE_SERVICE_NAME ?= $(subst _,-,$(DOCKER_COMPOSE_PROJECT_NAME))
|
||||
DOCKER_COMPOSE_UP_OPTIONS ?= -d
|
||||
DOCKER_IMAGE_TAG ?= $(if $(filter true,$(DEPLOY)),$(if $(filter $(ENV),$(ENV_DEPLOY)),$(VERSION)),$(if $(DRONE_BUILD_NUMBER),$(DRONE_BUILD_NUMBER),latest))
|
||||
DOCKER_IMAGE_TAG ?= $(if $(filter true,$(DEPLOY)),$(if $(filter $(ENV),$(ENV_DEPLOY)),$(VERSION)),$(if $(DRONE_BUILD_NUMBER),$(DRONE_BUILD_NUMBER),$(ENV)))
|
||||
DOCKER_IMAGES ?= $(patsubst %/,%,$(patsubst docker/%,%,$(dir $(wildcard docker/*/Dockerfile))))
|
||||
DOCKER_PLUGIN ?= rexray/s3fs:latest
|
||||
DOCKER_PLUGIN_ARGS ?= $(foreach var,$(DOCKER_PLUGIN_VARS),$(if $(DOCKER_PLUGIN_$(var)),$(var)='$(DOCKER_PLUGIN_$(var))'))
|
||||
@@ -95,6 +99,7 @@ define docker-commit
|
||||
$(RUN) docker commit $(container) $(repository):$(tag)
|
||||
endef
|
||||
# function docker-compose: Run docker-compose with arg 1
|
||||
# TODO: accept $2 COMPOSE_FILE and remove stack from prereq
|
||||
define docker-compose
|
||||
$(call INFO,docker-compose,$(1))
|
||||
$(if $(COMPOSE_FILE),
|
||||
|
||||
+5
-5
@@ -19,10 +19,9 @@ APP_REPOSITORY_SCHEME ?= $(shell printf '$(APP_REPOSITORY_URL)\n' |sed
|
||||
APP_REPOSITORY_URI ?= $(shell printf '$(APP_REPOSITORY_URL)\n' |sed 's|.*://||;')
|
||||
APP_REPOSITORY_URL ?= $(GIT_REPOSITORY)
|
||||
APP_REQUIRED ?= $(APP_REPOSITORY)
|
||||
APP_SCHEME ?= https
|
||||
APP_SCHEME ?= http
|
||||
APP_UPSTREAM_REPOSITORY ?= $(or $(shell git config --get remote.upstream.url 2>/dev/null),$(GIT_UPSTREAM_REPOSITORY))
|
||||
APP_URI ?= $(patsubst %,%/$(APP_PATH),$(APP_HOST))
|
||||
APP_URIS ?= $(APP_URI)
|
||||
APP_URL ?= $(patsubst %,$(APP_SCHEME)://%,$(APP_URI))
|
||||
APP_VERSION ?= $(VERSION)
|
||||
CONTEXT += APP APPS BRANCH DOMAIN VERSION RELEASE
|
||||
@@ -38,10 +37,11 @@ SERVICES ?= $(DOCKER_SERVICES)
|
||||
envprefix = $(foreach env,$(3),$(if $($(call UPPERCASE,$(1)_SERVICE_$(2)_$(env))),$(env)=$($(call UPPERCASE,$(1)_SERVICE_$(2)_$(env)))))
|
||||
patsublist = $(patsubst $(1),$(2),$(firstword $(3)))$(foreach pattern,$(wordlist 2,255,$(3)),$(comma)$(patsubst $(1),$(2),$(pattern)))
|
||||
servicenvs = $(foreach env,$(call UPPERCASE,$($(1)_SERVICE_$(2)_ENVS)),$(if $(3),$($(1)_SERVICE_$(env)_$(3)),$($(1)_SERVICE_$(2)_$(env))))
|
||||
tagprefix = $(call urlprefix,$(or $($(call UPPERCASE,$(1)_SERVICE_$(2)_PATH)),$($(call UPPERCASE,$(1)_SERVICE_PATH))),$(or $($(call UPPERCASE,$(1)_SERVICE_$(2)_OPTS)),$($(call UPPERCASE,$(1)_SERVICE_OPTS)),$(call envprefix,$(1),$(2),allow auth deny preprend proto register strip)),$(or $(foreach env,$(3),$($(call UPPERCASE,$(1)_SERVICE_$(2)_$(env)))),$($(call UPPERCASE,$(1)_SERVICE_$(2)_URIS)),$(call uriprefix,$(1),$(2))))
|
||||
uriprefix = $(foreach svc,$(1),$(patsubst %,$(addsuffix .,$(or $($(call UPPERCASE,$(svc)_SERVICE_$(2)_NAME)),$($(call UPPERCASE,$(svc)_SERVICE_NAME)),$(svc)))%,$(or $(3),$(APP_URIS))))
|
||||
tagprefix = $(call urlprefix,$(or $($(call UPPERCASE,$(1)_SERVICE_$(2)_PATH)),$($(call UPPERCASE,$(1)_SERVICE_PATH))),$(or $($(call UPPERCASE,$(1)_SERVICE_$(2)_OPTS)),$($(call UPPERCASE,$(1)_SERVICE_OPTS)),$(call envprefix,$(1),$(2),allow auth deny preprend proto register strip)),$(or $(foreach env,$(3),$($(call UPPERCASE,$(1)_SERVICE_$(2)_$(env)))),$($(call UPPERCASE,$(1)_SERVICE_$(2)_URIS)),$(call uri,$(1),$(2))))
|
||||
uri = $(foreach svc,$(1),$(patsubst %,$(addsuffix .,$(or $($(call UPPERCASE,$(svc)_SERVICE_$(2)_NAME)),$($(call UPPERCASE,$(svc)_SERVICE_NAME)),$(svc)))%,$(or $(3),$(APP_URI))))
|
||||
url = $(patsubst %,$(APP_SCHEME)://%,$(call uri,$(1),$(2),$(or $(3),$(APP_URI))))
|
||||
url_suffix = *
|
||||
urlprefix = $(strip $(call patsublist,%,urlprefix-%$(1)$(url_suffix) $(2),$(or $(3),$(APP_URIS))))
|
||||
urlprefix = $(strip $(call patsublist,%,urlprefix-%$(1)$(url_suffix) $(2),$(or $(3),$(APP_URI))))
|
||||
urlprefixs = $(strip $(call urlprefix,$(firstword $(1)),$(wordlist 2,16,$(1)))$(foreach prefix,$(subst $(space),$(dollar),$(2)) $(subst $(space),$(dollar),$(3)) $(subst $(space),$(dollar),$(4)),$(comma)$(call subst,$(dollar),$(space),$(call urlprefix,$(firstword $(prefix)),$(wordlist 2,16,$(prefix))))))
|
||||
## urlprefix tests (x APP_URI)
|
||||
# $(call urlprefix)
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
MAKECMDARGS += ufw ufw-docker
|
||||
UFW_UPDATE ?= $(or $(SERVICE),$(DOCKER_SERVICES))
|
||||
|
||||
ifeq ($(SETUP_UFW),true)
|
||||
|
||||
# function ufw: Exec command ufw with args 1
|
||||
define ufw
|
||||
$(call INFO,ufw,$(1)$(comma))
|
||||
@@ -18,5 +16,3 @@ define ufw-docker
|
||||
$(eval DOCKER_COMPOSE_PROJECT_NAME := $(HOST_COMPOSE_PROJECT_NAME))
|
||||
$(call app-exec,,$(if $(DOCKER_RUN),,$(SUDO)) ufw-docker $(1))
|
||||
endef
|
||||
|
||||
endif
|
||||
|
||||
+32
-25
@@ -1,9 +1,9 @@
|
||||
##
|
||||
# DOCKER
|
||||
|
||||
# target docker-build: Fire docker-images-myos, Call docker-build-% target for each DOCKER_IMAGES
|
||||
# target docker-build: Fire docker-image-myos, Call docker-build-% target for each DOCKER_IMAGES
|
||||
.PHONY: docker-build
|
||||
docker-build: docker-images-myos
|
||||
docker-build: docker-image-myos
|
||||
$(foreach image,$(or $(SERVICE),$(DOCKER_IMAGES)),$(call make,docker-build-$(image)))
|
||||
|
||||
# target docker-build-%: Call docker-build for each Dockerfile in docker/% folder
|
||||
@@ -23,10 +23,10 @@ docker-commit: stack
|
||||
docker-commit-%: stack
|
||||
$(foreach service,$(or $(SERVICE),$(SERVICES)),$(call docker-commit,$(service),,,$*))
|
||||
|
||||
# target docker-compose-build: Fire docker-images-myos, Call docker-compose build SERVICE
|
||||
# target docker-compose-build: Fire docker-image-myos, Call docker-compose build SERVICE
|
||||
.PHONY: docker-compose-build
|
||||
docker-compose-build: DOCKER_RUN_OPTIONS += -it
|
||||
docker-compose-build: docker-images-myos stack
|
||||
docker-compose-build: docker-image-myos stack
|
||||
$(call docker-compose,build $(DOCKER_BUILD_ARGS) $(if $(filter $(SERVICE),$(SERVICES)),$(SERVICE)))
|
||||
|
||||
# target docker-compose-config: Call docker-compose config
|
||||
@@ -109,37 +109,38 @@ docker-compose-stop: stack
|
||||
# target docker-compose-up: Fire docker-image-myos, Call docker-compose up SERVICE
|
||||
.PHONY: docker-compose-up
|
||||
docker-compose-up: DOCKER_RUN_OPTIONS += -it
|
||||
docker-compose-up: docker-images-myos bootstrap-stack stack
|
||||
docker-compose-up: docker-image-myos bootstrap-stack stack
|
||||
$(call docker-compose,up $(DOCKER_COMPOSE_UP_OPTIONS) $(if $(filter $(SERVICE),$(SERVICES)),$(SERVICE)))
|
||||
|
||||
# target docker-images-myos: Call myos-docker-build-% target for each DOCKER_IMAGES_MYOS
|
||||
.PHONY: docker-images-myos
|
||||
docker-images-myos: MAKE_VARS += DOCKER_REPOSITORY STACK
|
||||
docker-images-myos:
|
||||
$(foreach image,$(subst $(quote),,$(DOCKER_IMAGES_MYOS)),$(call make,docker-build-$(image),$(MYOS)))
|
||||
# target docker-image-myos: Call myos-docker-build-% target for each MYOS_DOCKER_IMAGES
|
||||
.PHONY: docker-image-myos
|
||||
docker-image-myos: MAKE_VARS += DOCKER_REPOSITORY STACK
|
||||
docker-image-myos:
|
||||
$(foreach image,$(subst $(quote),,$(MYOS_DOCKER_IMAGES)),$(call make,docker-build-$(image),$(MYOS)))
|
||||
|
||||
# target docker-images-rm: Remove docker images matching DOCKER_REPOSITORY
|
||||
.PHONY: docker-images-rm
|
||||
docker-images-rm:
|
||||
docker images |awk '$$1 ~ /^$(subst /,\/,$(DOCKER_REPOSITORY)/)/ {print $$3}' |sort -u |while read image; do $(RUN) docker rmi -f $$image; done
|
||||
# target docker-image-rm: Remove docker images matching DOCKER_REPOSITORY
|
||||
.PHONY: docker-image-rm
|
||||
docker-image-rm:
|
||||
docker image ls |awk '$$1 ~ /^$(subst /,\/,$(DOCKER_REPOSITORY)/)/ {print $$3}' |sort -u |while read image; do $(RUN) docker rmi -f $$image; done
|
||||
|
||||
# target docker-images-rm-%: Remove docker images matching %
|
||||
.PHONY: docker-images-rm-%
|
||||
docker-images-rm-%:
|
||||
docker images |awk '$$1 ~ /^$(subst /,\/,$*)/ {print $$3}' |sort -u |while read image; do $(RUN) docker rmi -f $$image; done
|
||||
# target docker-image-rm-%: Remove docker images matching %
|
||||
.PHONY: docker-image-rm-%
|
||||
docker-image-rm-%:
|
||||
$(foreach image,$(or $($(call UPPERCASE,$*)_DOCKER_IMAGES),$*), \
|
||||
docker image ls |awk '$$1 ~ /^$(subst /,\/,$(firstword $(subst :, ,$(image))))/ {print $$3}' |sort -u |while read image; do $(RUN) docker rmi -f $$image; done;)
|
||||
|
||||
# target docker-login: Run 'docker login'
|
||||
.PHONY: docker-login
|
||||
docker-login: myos-user
|
||||
$(RUN) docker login
|
||||
|
||||
# target docker-network: Fire docker-network-create-% for DOCKER_NETWORK and DOCKER_NETWORK_PUBLIC
|
||||
# target docker-network: Fire docker-network-create
|
||||
.PHONY: docker-network
|
||||
docker-network: docker-network-create docker-network-create-$(DOCKER_NETWORK_PUBLIC)
|
||||
docker-network: docker-network-create
|
||||
|
||||
# target docker-network-create: Fire docker-network-create-% for DOCKER_NETWORK
|
||||
# target docker-network-create: Fire docker-network-create-% for DOCKER_NETWORK_PRIVATE and DOCKER_NETWORK_PUBLIC
|
||||
.PHONY: docker-network-create
|
||||
docker-network-create: docker-network-create-$(DOCKER_NETWORK)
|
||||
docker-network-create: docker-network-create-$(DOCKER_NETWORK_PRIVATE) docker-network-create-$(DOCKER_NETWORK_PUBLIC)
|
||||
|
||||
# target docker-network-create-%: Run 'docker network create %'
|
||||
.PHONY: docker-network-create-%
|
||||
@@ -150,9 +151,9 @@ docker-network-create-%:
|
||||
||: ; \
|
||||
fi
|
||||
|
||||
# target docker-network-rm: Fire docker-network-rm-% for DOCKER_NETWORK
|
||||
# target docker-network-rm: Fire docker-network-rm-% for DOCKER_NETWORK_PRIVATE and DOCKER_NETWORK_PUBLIC
|
||||
.PHONY: docker-network-rm
|
||||
docker-network-rm: docker-network-rm-$(DOCKER_NETWORK)
|
||||
docker-network-rm: docker-network-rm-$(DOCKER_NETWORK_PRIVATE) docker-network-rm-$(DOCKER_NETWORK_PUBLIC)
|
||||
|
||||
# target docker-network-rm-%: Run 'docker network rm %'
|
||||
.PHONY: docker-network-rm-%
|
||||
@@ -226,9 +227,15 @@ docker-run-%: docker-build-%
|
||||
$(eval command := $(ARGS))
|
||||
$(eval path := $(patsubst %/,%,$*))
|
||||
$(eval image := $(DOCKER_REPOSITORY)/$(lastword $(subst /, ,$(path)))$(if $(findstring :,$*),,:$(DOCKER_IMAGE_TAG)))
|
||||
$(eval image_id := $(shell docker images -q $(image) 2>/dev/null))
|
||||
$(eval image_id := $(shell docker image ls -q $(image) 2>/dev/null))
|
||||
$(call docker-run,$(if $(image_id),$(image),$(path)),$(command))
|
||||
|
||||
# target docker-stack-%: Call docker-compose-% target for each STACK
|
||||
.PHONY: docker-stack-%
|
||||
docker-stack-%: MAKE_VARS += DOCKER_COMPOSE_DOWN_OPTIONS
|
||||
docker-stack-%:
|
||||
$(foreach stack, $(STACK), $(call make,docker-compose-$* STACK=$(stack) APP_NAME=$(subst _,,$(subst -,,$(subst .,,$(call LOWERCASE,$(firstword $(subst /, ,$(stack)))))))))
|
||||
|
||||
# target docker-tag: Call docker-tag for each SERVICES
|
||||
.PHONY: docker-tag
|
||||
docker-tag: stack
|
||||
|
||||
+6
-1
@@ -1,8 +1,11 @@
|
||||
# target ufw: Call ufw ARGS
|
||||
|
||||
.PHONY: ufw
|
||||
ufw:
|
||||
$(call ufw,$(ARGS))
|
||||
|
||||
ifeq ($(SETUP_UFW),true)
|
||||
|
||||
# target ufw-bootstrap: Eval ufw-docker app variables
|
||||
ufw-bootstrap:
|
||||
$(eval APP_COMPOSE_FILE :=)
|
||||
@@ -33,7 +36,7 @@ ufw-install:
|
||||
|
||||
# target ufw-up: Start ufw-docker docker
|
||||
ufw-up: DOCKER_RUN_NETWORK :=
|
||||
ufw-up: DOCKER_RUN_OPTIONS := --restart always -d --cap-add NET_ADMIN -v /etc/ufw:/etc/ufw $(if wildcard /etc/default/ufw,-v /etc/default/ufw:/etc/default/ufw) --network host
|
||||
ufw-up: DOCKER_RUN_OPTIONS := --restart always -d --cap-add NET_ADMIN -v /etc/ufw:/etc/ufw $(if $(wildcard /etc/default/ufw),-v /etc/default/ufw:/etc/default/ufw) --network host
|
||||
ufw-up:
|
||||
$(call app-up)
|
||||
|
||||
@@ -65,3 +68,5 @@ ufw-%:
|
||||
$(call make,ufw-$(command) STACK="$(stack)") \
|
||||
) \
|
||||
)
|
||||
|
||||
endif
|
||||
|
||||
+9
-3
@@ -6,6 +6,11 @@ DOCKER_IMAGE ?= $(USER_DOCKER_IMAGE)
|
||||
DOCKER_MACHINE ?= $(shell docker run --rm alpine uname -m 2>/dev/null)
|
||||
DOCKER_NAME ?= $(USER_DOCKER_NAME)
|
||||
DOCKER_NETWORK ?= $(if $(USER_STACK),$(USER),$(DOCKER_NETWORK_PRIVATE))
|
||||
# https://github.com/moby/libnetwork/issues/2093
|
||||
# network interface are attached ordered by name
|
||||
# default should be first to prevent cross stack
|
||||
# connections to other services with same name
|
||||
DOCKER_NETWORK_DEFAULT ?= _$(COMPOSE_PROJECT_NAME)
|
||||
DOCKER_NETWORK_PRIVATE ?= $(USER)-$(ENV)
|
||||
DOCKER_NETWORK_PUBLIC ?= $(HOSTNAME)
|
||||
# DOCKER_RUN: if empty, run system command, else run it in a docker
|
||||
@@ -16,15 +21,16 @@ DOCKER_RUN_NETWORK += --network $(DOCKER_NETWORK)
|
||||
DOCKER_RUN_OPTIONS += --rm
|
||||
DOCKER_RUN_VOLUME ?= $(patsubst %,-v %,$(DOCKER_VOLUME))
|
||||
DOCKER_RUN_WORKDIR ?= $(if $(DOCKER_WORKDIR),-w $(DOCKER_WORKDIR))
|
||||
DOCKER_SOCKET_LOCATION ?= /var/run/docker.sock
|
||||
DOCKER_SYSTEM ?= $(shell docker run --rm alpine uname -s 2>/dev/null)
|
||||
DOCKER_VOLUME ?= /var/run/docker.sock:/var/run/docker.sock
|
||||
DOCKER_VOLUME ?= $(DOCKER_SOCKET_LOCATION):/var/run/docker.sock
|
||||
DOCKER_WORKDIR ?= $(PWD)
|
||||
ENV_VARS += DOCKER_MACHINE DOCKER_NETWORK DOCKER_NETWORK_PRIVATE DOCKER_NETWORK_PUBLIC DOCKER_SYSTEM HOST_COMPOSE_PROJECT_NAME HOST_COMPOSE_SERVICE_NAME HOST_DOCKER_REPOSITORY HOST_DOCKER_VOLUME HOST_GID HOST_UID USER_COMPOSE_PROJECT_NAME USER_COMPOSE_SERVICE_NAME USER_DOCKER_IMAGE USER_DOCKER_NAME USER_DOCKER_REPOSITORY USER_DOCKER_VOLUME
|
||||
ENV_VARS += DOCKER_MACHINE DOCKER_NETWORK DOCKER_NETWORK_DEFAULT DOCKER_NETWORK_PRIVATE DOCKER_NETWORK_PUBLIC DOCKER_SOCKET_LOCATION DOCKER_SYSTEM HOST_COMPOSE_PROJECT_NAME HOST_COMPOSE_SERVICE_NAME HOST_DOCKER_REPOSITORY HOST_DOCKER_VOLUME HOST_GID HOST_UID USER_COMPOSE_PROJECT_NAME USER_COMPOSE_SERVICE_NAME USER_DOCKER_IMAGE USER_DOCKER_NAME USER_DOCKER_REPOSITORY USER_DOCKER_VOLUME
|
||||
HOST_COMPOSE_PROJECT_NAME ?= $(HOSTNAME)
|
||||
HOST_COMPOSE_SERVICE_NAME ?= $(subst _,-,$(HOST_COMPOSE_PROJECT_NAME))
|
||||
HOST_DOCKER_REPOSITORY ?= $(subst -,/,$(subst _,/,$(HOST_COMPOSE_PROJECT_NAME)))
|
||||
HOST_DOCKER_VOLUME ?= $(HOST_COMPOSE_PROJECT_NAME)
|
||||
HOST_GID ?= 100
|
||||
HOST_GID ?= $(HOST_UID)
|
||||
HOST_UID ?= 123
|
||||
HOST_STACK ?= $(filter host,$(firstword $(subst /, ,$(STACK))))
|
||||
MYOS_STACK ?= $(MYOS)/stack/myos
|
||||
|
||||
+30
-3
@@ -76,7 +76,7 @@ IGNORE_VERBOSE ?= false
|
||||
INSTALL ?= $(RUN) $(SUDO) $(subst &&,&& $(RUN) $(SUDO),$(INSTALL_CMD))
|
||||
INSTALL_CMDS ?= APK_INSTALL APT_INSTALL
|
||||
$(foreach cmd,$(INSTALL_CMDS),$(if $(CMD_$(cmd)),$(eval INSTALL_CMD ?= $(CMD_$(cmd)))))
|
||||
LOG_LEVEL ?= $(if $(DEBUG),debug,$(if $(VERBOSE),info,error))
|
||||
LOG_LEVEL := $(or $(if $(DEBUG),debug),$(if $(VERBOSE),info),error)
|
||||
MAIL ?= $(GIT_AUTHOR_EMAIL)
|
||||
MAKE_ARGS = $(foreach var,$(MAKE_VARS),$(if $($(var)),$(var)='$($(var))'))
|
||||
MAKE_SUBDIRS ?= $(if $(filter myos,$(MYOS)),monorepo,$(if $(APP),apps $(foreach type,$(APP_LOAD),$(if $(wildcard $(MAKE_DIR)/apps/$(type)),apps/$(type)))))
|
||||
@@ -90,7 +90,7 @@ MAKE_OLDFILE ?= $@
|
||||
MAKE_TARGETS ?= $(filter-out $(.VARIABLES),$(shell $(MAKE) -qp 2>/dev/null |awk -F':' '/^[a-zA-Z0-9][^$$\#\/\t=]*:([^=]|$$)/ {print $$1}' 2>/dev/null |sort -u))
|
||||
MAKE_UNIXTIME_START := $(shell date -u +'%s' 2>/dev/null)
|
||||
MAKE_UNIXTIME_CURRENT = $(shell date -u "+%s" 2>/dev/null)
|
||||
MAKE_VARS := ENV COMPOSE_FILE DOCKER_COMPOSE DOCKER_MACHINE DOCKER_SERVICES DOCKER_SYSTEM
|
||||
MAKE_VARS := ENV COMPOSE_FILE DOCKER_COMPOSE DOCKER_SERVICES
|
||||
MAKECMDARGS ?= apps-install install-app
|
||||
MONOREPO ?= $(if $(filter myos,$(MYOS)),$(notdir $(CURDIR)),$(if $(APP),$(notdir $(realpath $(CURDIR)/..))))
|
||||
MONOREPO_DIR ?= $(if $(MONOREPO),$(if $(filter myos,$(MYOS)),$(realpath $(CURDIR)),$(if $(APP),$(realpath $(CURDIR)/..))))
|
||||
@@ -174,6 +174,30 @@ INFO = $(if $(VERBOSE),$(if $(filter-out true,$(IGNORE_VERBOSE)), \
|
||||
&& printf '\n' >&$(INFO_FD) \
|
||||
))
|
||||
|
||||
# macro base64t: Print trimed base64 encoded string from $1
|
||||
base64t = $(shell echo -en '$(1)' |openssl enc -A -base64 |sed 's/+/-/g;s|/|_|g;s/=*$$//;')
|
||||
|
||||
# macro hs256: Print hmac sha256 digest from string $1 with key $2
|
||||
hs256 = $(shell echo -n '$(1)' |openssl dgst -sha256 -binary -hmac '$(2)')
|
||||
b64_hs256 = $(shell echo -n '$(1)' |openssl dgst -sha256 -binary -hmac '$(2)' |base64 |sed 's/+/-/g;s|/|_|g;s/=*$$//;')
|
||||
|
||||
# macro rs256: Print sha256 digest from string $1 signed by key $2
|
||||
rs256 = $(shell echo -n '$(1)' |openssl dgst -sha256 -binary -sign '$(2)')
|
||||
|
||||
JWT_HEADER = {"alg":"HS256","typ":"JWT"}
|
||||
|
||||
# macro JWT: Print Json Web Token for header $1 payload $2 and key $3
|
||||
JWT = $(strip \
|
||||
$(eval header := $(or $(1),$(JWT_HEADER))) \
|
||||
$(eval payload := $(or $(2),$(JWT_PAYLOAD))) \
|
||||
$(eval secret := $(or $(3),$(JWT_SECRET))) \
|
||||
$(eval b64_header := $(call base64t,$(header))) \
|
||||
$(eval b64_payload := $(call base64t,$(payload))) \
|
||||
$(eval b64_signature := $(call base64t,$(call hs256,$(b64_header).$(b64_payload),$(secret)))) \
|
||||
$(eval b64_signature := $(call b64_hs256,$(b64_header).$(b64_payload),$(secret))) \
|
||||
$(if $(DEBUG),$(header) - $(payload) - $(secret)) \
|
||||
$(b64_header).$(b64_payload).$(b64_signature))
|
||||
|
||||
# macro RESU: Print USER associated to MAIL
|
||||
RESU = $(strip \
|
||||
$(if $(findstring @,$(MAIL)), \
|
||||
@@ -227,9 +251,12 @@ force = $$(while true; do \
|
||||
&& $(RUN) $(1) || sleep 1; done \
|
||||
)
|
||||
|
||||
# macro gid: Return GID of group 1
|
||||
# macro gid: Return GID of group $1
|
||||
gid = $(shell awk -F':' '$$1 == "$(1)" {print $$3}' /etc/group 2>/dev/null)
|
||||
|
||||
# macro newenv: Return VAR from file $2 that does not exist in file $1, matching on VAR= part of lines
|
||||
newenv = $(shell awk -F'=' 'NR == FNR {if($$1 !~ /^(\#|$$)/) { A[$$1]; next }} !($$1 in A) {if($$1 !~ /^(\#|$$)/) { print $$1 }}' $(1) $(2) 2>/dev/null)
|
||||
|
||||
# macro newer: Return the newest file
|
||||
newer = $(shell stat $(STAT_FORMAT_ARG) $(STAT_FORMAT_FILE) $(1) $(2) $(if $(DEBUG),,2>/dev/null) |sort -n |tail -n1 |awk '{print $$2}')
|
||||
|
||||
|
||||
+3
-3
@@ -11,7 +11,7 @@
|
||||
## it removes file .env
|
||||
.PHONY: .env-clean
|
||||
.env-clean:
|
||||
$(RUN) rm -$(if $(FORCE),f,i) .env || true
|
||||
$(RUN) rm -$(if $(FORCE),f,i) $(ENV_FILE) || true
|
||||
|
||||
# target .env-update: Update file ENV_FILE
|
||||
## it updates file ENV_FILE with missing values from file ENV_DIST
|
||||
@@ -51,8 +51,8 @@ define .env
|
||||
$(eval env_file:=$(or $(1),.env))
|
||||
$(eval env_dists:=$(wildcard $(or $(2),$(env_file).dist)))
|
||||
$(eval env_over:=$(wildcard $(or $(3),$(env_file).$(ENV))))
|
||||
$(if $(FORCE)$(filter $(env_file),$(call newer,$(env_file) $(env_dists) $(env_over))),
|
||||
,$(foreach env_dist,$(env_dists),$(call .env_update)))
|
||||
$(if $(FORCE)$(call newenv,$(env_file),$(env_dists) $(env_over))$(if $(wildcard $(env_file)),,FORCE),
|
||||
$(foreach env_dist,$(env_dists),$(call .env_update)))
|
||||
endef
|
||||
|
||||
# function .env_update: Update .env file with values from .env.dist
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
ENV_VARS += USER_IPFS_API_HTTPHEADERS_ACA_ORIGIN USER_IPFS_LETSENCRYPT_HOST USER_IPFS_PATH USER_IPFS_SERVICE_5001_TAGS USER_IPFS_SERVICE_8080_TAGS
|
||||
USER_IPFS_API_HTTPHEADERS_ACA_ORIGIN ?= [$(call patsublist,%,"https://%",$(patsubst %/,%,$(USER_IPFS_SERVICE_8080_URIS)))]
|
||||
USER_IPFS_LETSENCRYPT_HOST ?= $(subst $(space),$(comma),$(call uriprefix,USER_IPFS,,$(USER_HOST)))
|
||||
USER_IPFS_LETSENCRYPT_HOST ?= $(subst $(space),$(comma),$(call uri,USER_IPFS,,$(USER_HOST)))
|
||||
USER_IPFS_PATH ?= $(USER_HOME)/.ipfs
|
||||
USER_IPFS_SERVICE_NAME ?= ipfs
|
||||
USER_IPFS_SERVICE_5001_PATH ?= api/
|
||||
@@ -8,7 +8,7 @@ USER_IPFS_SERVICE_5001_TAGS ?= $(or $(USER_IPFS_SERVICE_5001_TAGS_
|
||||
USER_IPFS_SERVICE_5001_TAGS_LOCALHOST ?= $(filter %.localhost/$(USER_PATH)$(USER_IPFS_SERVICE_5001_PATH)$(url_suffix),$(call tagprefix,USER_IPFS,5001))
|
||||
USER_IPFS_SERVICE_5001_TAGS_PROXY_TCP ?= $(call patsublist,%,urlprefix-% proxy=tcp,$(USER_IPFS_SERVICE_PROXY_TCP))
|
||||
USER_IPFS_SERVICE_5001_TAGS_URIS ?= $(strip $(if $(call servicenvs,USER_IPFS,5001,URIS),$(call urlprefix,$(USER_IPFS_SERVICE_5001_PATH),,$(call servicenvs,USER_IPFS,5001,URIS))))
|
||||
USER_IPFS_SERVICE_5001_URIS ?= $(call uriprefix,USER_IPFS,5001,$(USER_URIS))
|
||||
USER_IPFS_SERVICE_5001_URIS ?= $(call uri,USER_IPFS,5001,$(USER_URIS))
|
||||
USER_IPFS_SERVICE_8080_OPTS ?= $(patsubst %/,%,$(if $(USER_PATH),strip=/$(USER_PATH)))
|
||||
USER_IPFS_SERVICE_8080_TAGS ?= $(call tagprefix,USER_IPFS,8080)
|
||||
USER_IPFS_SERVICE_8080_URIS ?= $(call uriprefix,USER_IPFS,8080,$(USER_URIS))
|
||||
USER_IPFS_SERVICE_8080_URIS ?= $(call uri,USER_IPFS,8080,$(USER_URIS))
|
||||
|
||||
@@ -16,4 +16,4 @@ services:
|
||||
- private
|
||||
restart: always
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ${DOCKER_SOCKET_LOCATION}:/var/run/docker.sock
|
||||
|
||||
+1
-1
@@ -10,4 +10,4 @@ services:
|
||||
- private
|
||||
restart: always
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ${DOCKER_SOCKET_LOCATION}:/var/run/docker.sock
|
||||
|
||||
@@ -3,7 +3,7 @@ DUNITER_UI_SERVICE_NAME ?= $(DUNITER_V2S_SERVICE_NAME)
|
||||
DUNITER_UI_SERVICE_80_PATH ?= ui/
|
||||
DUNITER_UI_SERVICE_80_STRIP ?= /ui
|
||||
DUNITER_UI_SERVICE_80_TAGS ?= $(call tagprefix,DUNITER_UI,80)
|
||||
DUNITER_UI_WS_URL ?= wss://$(DUNITER_V2S_SERVICE_NAME).$(firstword $(APP_URIS))$(firstword $(DUNITER_V2S_SERVICE_9944_PATH))
|
||||
DUNITER_UI_WS_URL ?= wss://$(DUNITER_V2S_SERVICE_NAME).$(firstword $(APP_URI))$(firstword $(DUNITER_V2S_SERVICE_9944_PATH))
|
||||
DUNITER_V2S_DUNITER_CHAIN_NAME ?= gdev
|
||||
DUNITER_V2S_DUNITER_NODE_NAME ?= $(USER)-$(ENV)-$(DUNITER_V2S_DUNITER_PRUNING_PROFILE)
|
||||
DUNITER_V2S_DUNITER_PUBLIC_ADDR ?= /dns/$(DUNITER_V2S_SERVICE_NAME).$(firstword $(APP_HOST))/tcp/443/wss
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ services:
|
||||
volumes_from:
|
||||
- nginx
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- ${DOCKER_SOCKET_LOCATION}:/var/run/docker.sock:ro
|
||||
- acme:/etc/acme.sh
|
||||
- certs:/etc/nginx/certs
|
||||
- html:/usr/share/nginx/html
|
||||
|
||||
@@ -8,4 +8,4 @@ services:
|
||||
image: willfarrell/autoheal:latest
|
||||
restart: always
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ${DOCKER_SOCKET_LOCATION}:/var/run/docker.sock
|
||||
|
||||
@@ -42,7 +42,7 @@ services:
|
||||
restart: always
|
||||
volumes:
|
||||
- consul:/consul/data:delegated
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ${DOCKER_SOCKET_LOCATION}:/var/run/docker.sock
|
||||
|
||||
volumes:
|
||||
consul:
|
||||
|
||||
+1
-1
@@ -6,5 +6,5 @@ HOST_IPFS_SERVICE_5001_PATH ?= api/
|
||||
HOST_IPFS_SERVICE_5001_TAGS ?= $(call tagprefix,HOST_IPFS,5001)
|
||||
HOST_IPFS_SERVICE_8080_ENVS ?= host
|
||||
HOST_IPFS_SERVICE_8080_TAGS ?= $(call urlprefix,,,$(HOST_IPFS_SERVICE_8080_URIS) $(call servicenvs,HOST_IPFS,8080,URIS))
|
||||
HOST_IPFS_SERVICE_8080_URIS ?= $(call uriprefix,ipfs *.ipns)
|
||||
HOST_IPFS_SERVICE_8080_URIS ?= $(call uri,ipfs *.ipns)
|
||||
HOST_IPFS_UFW_UPDATE ?= 4001/tcp 4001/udp 8080
|
||||
|
||||
@@ -38,7 +38,7 @@ services:
|
||||
- 443
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||
- ${DOCKER_SOCKET_LOCATION}:/tmp/docker.sock:ro
|
||||
- certs:/etc/nginx/certs
|
||||
- html:/usr/share/nginx/html
|
||||
- htpasswd:/etc/nginx/htpasswd
|
||||
|
||||
@@ -16,7 +16,7 @@ services:
|
||||
- 9000
|
||||
restart: always
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ${DOCKER_SOCKET_LOCATION}:/var/run/docker.sock
|
||||
- portainer:/data
|
||||
|
||||
volumes:
|
||||
|
||||
@@ -25,4 +25,4 @@ services:
|
||||
network_mode: host
|
||||
restart: always
|
||||
volumes:
|
||||
- /var/run/docker.sock:/tmp/docker.sock
|
||||
- ${DOCKER_SOCKET_LOCATION}:/tmp/docker.sock
|
||||
|
||||
+1
-1
@@ -6,7 +6,7 @@ IPFS_SERVICE_5001_PATH ?= api/
|
||||
IPFS_SERVICE_5001_TAGS ?= $(call tagprefix,ipfs,5001)
|
||||
IPFS_SERVICE_8080_CHECK_HTTP ?= /ipfs/QmUNLLsPACCz1vLxQVkXqqLX5R1X345qqfHbsf67hvA3Nn
|
||||
IPFS_SERVICE_8080_TAGS ?= $(call urlprefix,,,$(IPFS_SERVICE_8080_URIS))
|
||||
IPFS_SERVICE_8080_URIS ?= $(call uriprefix,ipfs *.ipns)
|
||||
IPFS_SERVICE_8080_URIS ?= $(call uri,ipfs *.ipns)
|
||||
IPFS_VERSION ?= 0.16.0
|
||||
|
||||
.PHONY: bootstrap-stack-ipfs
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
networks:
|
||||
default:
|
||||
name: ${DOCKER_NETWORK_DEFAULT:-_default}
|
||||
private:
|
||||
external: true
|
||||
name: ${DOCKER_NETWORK_PRIVATE:-docker}
|
||||
|
||||
@@ -28,7 +28,7 @@ services:
|
||||
- 443
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- /var/run/docker.sock:/tmp/docker.sock:ro
|
||||
- ${DOCKER_SOCKET_LOCATION}:/tmp/docker.sock:ro
|
||||
- certs:/etc/nginx/certs
|
||||
- html:/usr/share/nginx/html
|
||||
- log:/var/log/nginx
|
||||
|
||||
@@ -15,7 +15,7 @@ services:
|
||||
- 9000
|
||||
restart: always
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ${DOCKER_SOCKET_LOCATION}:/var/run/docker.sock
|
||||
- portainer:/data
|
||||
|
||||
volumes:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
ENV_VARS += PROMETHEUS_BLACKBOX_PRIMARY_TARGETS PROMETHEUS_BLACKBOX_SECONDARY_TARGETS PROMETHEUS_SERVICE_9090_TAGS
|
||||
PROMETHEUS_BLACKBOX_PRIMARY_TARGETS ?= $(patsubst %,https://%,$(DOMAIN))
|
||||
PROMETHEUS_BLACKBOX_SECONDARY_TARGETS ?= $(patsubst %,https://%,$(APP_URIS))
|
||||
PROMETHEUS_BLACKBOX_SECONDARY_TARGETS ?= $(patsubst %,https://%,$(APP_URI))
|
||||
PROMETHEUS_SERVICE_9090_NAME ?= prometheus
|
||||
PROMETHEUS_SERVICE_9090_TAGS ?= $(call tagprefix,prometheus,9090)
|
||||
|
||||
@@ -20,4 +20,4 @@ services:
|
||||
- 514
|
||||
restart: always
|
||||
volumes:
|
||||
- /var/run/docker.sock:/tmp/docker.sock
|
||||
- ${DOCKER_SOCKET_LOCATION}:/tmp/docker.sock
|
||||
|
||||
@@ -33,7 +33,7 @@ services:
|
||||
volumes:
|
||||
- sources:/Sources:cached
|
||||
- user:/tmp/ssh-agent:ro
|
||||
- /var/run/docker.sock:/var/run/docker.sock
|
||||
- ${DOCKER_SOCKET_LOCATION}:/var/run/docker.sock
|
||||
|
||||
volumes:
|
||||
sources:
|
||||
|
||||
Reference in New Issue
Block a user