@@ -733,7 +733,8 @@ publish: verify ## Verify, then upload to PyPI
733
733
# =============================================================================
734
734
# help: 🦭 PODMAN CONTAINER BUILD & RUN
735
735
# help: podman-dev - Build development container image
736
- # help: podman - Build production container image
736
+ # help: podman - Build container image
737
+ # help: podman-prod - Build production container image (using ubi-micro → scratch). Not supported on macOS.
737
738
# help: podman-run - Run the container on HTTP (port 4444)
738
739
# help: podman-run-shell - Run the container on HTTP (port 4444) and start a shell
739
740
# help: podman-run-ssl - Run the container on HTTPS (port 4444, self-signed)
@@ -873,6 +874,7 @@ podman-shell:
873
874
# help: 🐋 DOCKER BUILD & RUN
874
875
# help: docker-dev - Build development Docker image
875
876
# help: docker - Build production Docker image
877
+ # help: docker-prod - Build production container image (using ubi-micro → scratch). Not supported on macOS.
876
878
# help: docker-run - Run the container on HTTP (port 4444)
877
879
# help: docker-run-ssl - Run the container on HTTPS (port 4444, self-signed)
878
880
# help: docker-stop - Stop & remove the container
@@ -892,6 +894,16 @@ docker:
892
894
@echo " 🐋 Building production Docker image…"
893
895
docker build --platform=linux/amd64 -t $(IMG_DOCKER_PROD ) -f Containerfile .
894
896
897
+ docker-prod :
898
+ @echo " 🦭 Building production container from Containerfile.lite (ubi-micro → scratch)…"
899
+ docker build --ssh default \
900
+ --platform=linux/amd64 \
901
+ --squash \
902
+ -f Containerfile.lite \
903
+ -t $(IMG_PROD ) \
904
+ .
905
+ docker images $(IMG_PROD )
906
+
895
907
# # -------------------- R U N (HTTP) ---------------------------------------
896
908
docker-run :
897
909
@echo " 🚀 Starting Docker container (HTTP)…"
@@ -958,6 +970,86 @@ docker-shell:
958
970
@echo " 🔧 Opening shell in Docker container…"
959
971
@docker exec -it $(PROJECT_NAME ) bash || docker exec -it $(PROJECT_NAME ) /bin/sh
960
972
973
+
974
+ # =============================================================================
975
+ # 🛠️ COMPOSE STACK (Docker Compose v2, podman compose or podman-compose)
976
+ # =============================================================================
977
+ # help: 🛠️ COMPOSE STACK - Build / start / stop the multi-service stack
978
+ # help: compose-up - Bring the whole stack up (detached)
979
+ # help: compose-restart - Recreate changed containers, pulling / building as needed
980
+ # help: compose-build - Build (or rebuild) images defined in the compose file
981
+ # help: compose-pull - Pull the latest images only
982
+ # help: compose-logs - Tail logs from all services (Ctrl-C to exit)
983
+ # help: compose-ps - Show container status table
984
+ # help: compose-shell - Open an interactive shell in the “gateway” container
985
+ # help: compose-stop - Gracefully stop the stack (keep containers)
986
+ # help: compose-down - Stop & remove containers (keep named volumes)
987
+ # help: compose-rm - Remove *stopped* containers
988
+ # help: compose-clean - ✨ Down **and** delete named volumes (data-loss ⚠)
989
+
990
+ # ─────────────────────────────────────────────────────────────────────────────
991
+ # You may **force** a specific binary by exporting COMPOSE_CMD, e.g.:
992
+ # export COMPOSE_CMD=podman-compose # classic wrapper
993
+ # export COMPOSE_CMD="podman compose" # Podman v4/v5 built-in
994
+ # export COMPOSE_CMD="docker compose" # Docker CLI plugin (v2)
995
+ #
996
+ # If COMPOSE_CMD is empty, we autodetect in this order:
997
+ # 1. podman-compose 2. podman compose 3. docker compose
998
+ # ─────────────────────────────────────────────────────────────────────────────
999
+ COMPOSE_CMD ?=
1000
+ ifeq ($(strip $(COMPOSE_CMD ) ) ,)
1001
+ COMPOSE_CMD := $(shell \
1002
+ command -v podman-compose >/dev/null 2>&1 && echo podman-compose || \
1003
+ command -v "podman compose" >/dev/null 2>&1 && echo "podman compose" || \
1004
+ echo "docker compose" )
1005
+ endif
1006
+ COMPOSE_FILE ?= podman-compose-mcpgateway.yaml
1007
+
1008
+ define COMPOSE
1009
+ $(COMPOSE_CMD ) -f $(COMPOSE_FILE )
1010
+ endef
1011
+
1012
+ .PHONY : compose-up compose-restart compose-build compose-pull \
1013
+ compose-logs compose-ps compose-shell compose-stop compose-down \
1014
+ compose-rm compose-clean
1015
+
1016
+ compose-up :
1017
+ @echo " 🚀 Using $( COMPOSE_CMD) ; starting stack..."
1018
+ $(COMPOSE ) up -d
1019
+
1020
+ compose-restart :
1021
+ @echo " 🔄 Restarting stack (build + pull if needed)…"
1022
+ $(COMPOSE ) up -d --pull=missing --build
1023
+
1024
+ compose-build :
1025
+ $(COMPOSE ) build
1026
+
1027
+ compose-pull :
1028
+ $(COMPOSE ) pull
1029
+
1030
+ compose-logs :
1031
+ $(COMPOSE ) logs -f
1032
+
1033
+ compose-ps :
1034
+ $(COMPOSE ) ps
1035
+
1036
+ compose-shell :
1037
+ $(COMPOSE ) exec gateway /bin/sh
1038
+
1039
+ compose-stop :
1040
+ $(COMPOSE ) stop
1041
+
1042
+ compose-down :
1043
+ $(COMPOSE ) down
1044
+
1045
+ compose-rm :
1046
+ $(COMPOSE ) rm -f
1047
+
1048
+ # Removes **containers + named volumes** – irreversible!
1049
+ compose-clean :
1050
+ $(COMPOSE ) down -v
1051
+
1052
+
961
1053
# =============================================================================
962
1054
# ☁️ IBM CLOUD CODE ENGINE
963
1055
# =============================================================================
@@ -1120,3 +1212,4 @@ ibmcloud-ce-status:
1120
1212
ibmcloud-ce-rm :
1121
1213
@echo " 🗑️ Deleting Code Engine app: $( IBMCLOUD_CODE_ENGINE_APP) …"
1122
1214
@ibmcloud ce application delete --name $(IBMCLOUD_CODE_ENGINE_APP ) -f
1215
+
0 commit comments