build(Makefile): run containers interactively (-it) when serving
This commit is contained in:
parent
320f848aa9
commit
ef66ab1538
17
Makefile
17
Makefile
@ -1,6 +1,7 @@
|
|||||||
SHELL=bash
|
SHELL=bash
|
||||||
|
|
||||||
export CONTAINER_COMMAND ?= podman
|
export CONTAINER_COMMAND ?= podman
|
||||||
|
export CONTAINER_INTERACTIVE
|
||||||
export IN_CONTAINER ?= false
|
export IN_CONTAINER ?= false
|
||||||
export IN_CI ?= false
|
export IN_CI ?= false
|
||||||
export WATCH
|
export WATCH
|
||||||
@ -42,6 +43,7 @@ release:
|
|||||||
##### UNIFIED FRONTEND/BACKEND TARGETS #####
|
##### UNIFIED FRONTEND/BACKEND TARGETS #####
|
||||||
|
|
||||||
.PHONY: serve
|
.PHONY: serve
|
||||||
|
serve: CONTAINER_INTERACTIVE=-it
|
||||||
serve:
|
serve:
|
||||||
$(MAKE) serve-database &
|
$(MAKE) serve-database &
|
||||||
$(MAKE) serve-frontend &
|
$(MAKE) serve-frontend &
|
||||||
@ -74,9 +76,14 @@ test: test-frontend test-backend i18n-check
|
|||||||
--compile-frontend: --frontend-dependencies
|
--compile-frontend: --frontend-dependencies
|
||||||
npx -- webpack --progress $(WATCH)
|
npx -- webpack --progress $(WATCH)
|
||||||
|
|
||||||
.PHONY: --serve-frontend
|
.PHONY: serve-frontend
|
||||||
--serve-frontend: WATCH=--watch
|
serve-frontend: CONTAINER_INTERACTIVE=-it
|
||||||
--serve-frontend: --compile-frontend;
|
serve-frontend:
|
||||||
|
$(MAKE) -- --containerized---compile-frontend WATCH=--watch
|
||||||
|
|
||||||
|
# .PHONY: --serve-frontend
|
||||||
|
# --serve-frontend: WATCH=--watch
|
||||||
|
# --serve-frontend: --compile-frontend;
|
||||||
|
|
||||||
.PHONY: --lint-frontend
|
.PHONY: --lint-frontend
|
||||||
--lint-frontend: eslint.config.js
|
--lint-frontend: eslint.config.js
|
||||||
@ -135,6 +142,7 @@ well-known/.well-known:
|
|||||||
--%-prod-backend: --image-build --containerized-%-backend;
|
--%-prod-backend: --image-build --containerized-%-backend;
|
||||||
|
|
||||||
.PHONY: serve-backend
|
.PHONY: serve-backend
|
||||||
|
serve-backend: CONTAINER_INTERACTIVE=-it
|
||||||
serve-backend:
|
serve-backend:
|
||||||
DEV_PORT_HTTP=`docker/backend/dev_port.pl 3000 | tee .dev-port-http` \
|
DEV_PORT_HTTP=`docker/backend/dev_port.pl 3000 | tee .dev-port-http` \
|
||||||
DEV_PORT_HTTPS=`docker/backend/dev_port.pl 3443 | tee .dev-port-https` \
|
DEV_PORT_HTTPS=`docker/backend/dev_port.pl 3443 | tee .dev-port-https` \
|
||||||
@ -165,6 +173,7 @@ database: .stack .stack-work.lock compile-backend-prod
|
|||||||
stack exec uniworxdb -- $(db)
|
stack exec uniworxdb -- $(db)
|
||||||
|
|
||||||
.PHONY: serve-database
|
.PHONY: serve-database
|
||||||
|
serve-database: CONTAINER_INTERACTIVE=-it
|
||||||
serve-database: --containerized-database
|
serve-database: --containerized-database
|
||||||
|
|
||||||
.PHONY: .stack
|
.PHONY: .stack
|
||||||
@ -225,7 +234,7 @@ image-rebuild-%:
|
|||||||
if [ "$(IN_CONTAINER)" == "true" ] ; then \
|
if [ "$(IN_CONTAINER)" == "true" ] ; then \
|
||||||
$(MAKE) -- $* ; \
|
$(MAKE) -- $* ; \
|
||||||
else \
|
else \
|
||||||
$(CONTAINER_COMMAND) run -v $(PWD):$${MOUNT_DIR} --env IN_CONTAINER=true --env FRADRIVE_MAKE_TARGET=$* fradrive/$(FRADRIVE_SERVICE) ; \
|
$(CONTAINER_COMMAND) run $(CONTAINER_INTERACTIVE) -v $(PWD):$${MOUNT_DIR} --env IN_CONTAINER=true --env FRADRIVE_MAKE_TARGET=$* fradrive/$(FRADRIVE_SERVICE) ; \
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##### CONTAINER TARGETS #####
|
##### CONTAINER TARGETS #####
|
||||||
|
|||||||
@ -19,6 +19,7 @@ services:
|
|||||||
- *fradrive-mnt
|
- *fradrive-mnt
|
||||||
depends_on:
|
depends_on:
|
||||||
- frontend
|
- frontend
|
||||||
|
stdin_open: true
|
||||||
database:
|
database:
|
||||||
# image: registry.uniworx.de/fradrive/fradrive/database
|
# image: registry.uniworx.de/fradrive/fradrive/database
|
||||||
# pull_policy: if_not_present
|
# pull_policy: if_not_present
|
||||||
|
|||||||
Reference in New Issue
Block a user