|
82 | 82 | $(FULLTAG) bash |
83 | 83 |
|
84 | 84 |
|
85 | | -# Expose the web server and the happy-server: |
86 | | -PORTS= -p 8081:8081 -p 3005:3005 |
| 85 | +# Port definitions for different modes |
| 86 | +PORTS_ALL= -p 8081:8081 -p 3005:3005 |
| 87 | +PORTS_WEB= -p 8081:8081 |
| 88 | +PORTS_SERVER= -p 3005:3005 |
| 89 | + |
| 90 | +# No ports forwarded by default (use root-all-ports, web, or server for specific needs) |
87 | 91 | root: |
88 | 92 | $(CONTAINER) run -it --rm -u root --hostname $(CONTAINER_HOSTNAME) \ |
89 | 93 | -v `pwd`/home:/root \ |
90 | 94 | -v `pwd`/..:$(WORKDIR) \ |
91 | | - $(PORTS) $(FULLTAG) bash |
| 95 | + $(FULLTAG) bash |
| 96 | + |
| 97 | +# All ports forwarded (legacy behavior) |
| 98 | +root-all-ports: |
| 99 | + $(CONTAINER) run -it --rm -u root --hostname $(CONTAINER_HOSTNAME) \ |
| 100 | + -v `pwd`/home:/root \ |
| 101 | + -v `pwd`/..:$(WORKDIR) \ |
| 102 | + $(PORTS_ALL) $(FULLTAG) bash |
| 103 | + |
| 104 | +# Web client only (port 8081) - starts the webapp directly |
| 105 | +web: |
| 106 | + $(CONTAINER) run -it --rm -u root --hostname $(CONTAINER_HOSTNAME) \ |
| 107 | + -v `pwd`/home:/root \ |
| 108 | + -v `pwd`/..:$(WORKDIR) \ |
| 109 | + $(PORTS_WEB) $(FULLTAG) \ |
| 110 | + bash -c "cd $(WORKDIR)/happy && yarn web" |
| 111 | + |
| 112 | +# Happy server only (port 3005) - starts the server directly |
| 113 | +server: |
| 114 | + $(CONTAINER) run -it --rm -u root --hostname $(CONTAINER_HOSTNAME) \ |
| 115 | + -v `pwd`/home:/root \ |
| 116 | + -v `pwd`/..:$(WORKDIR) \ |
| 117 | + $(PORTS_SERVER) $(FULLTAG) \ |
| 118 | + bash -c "cd $(WORKDIR) && ./happy-demo.sh start && tail -f /dev/null" |
92 | 119 |
|
93 | 120 | AGENT_LAYERS = Dockerfile.claude Dockerfile.copilot |
94 | 121 | # Dockerfile.gemini |
@@ -215,5 +242,5 @@ info: |
215 | 242 | @echo CONTAINER_HOSTNAME=$(CONTAINER_HOSTNAME) |
216 | 243 |
|
217 | 244 |
|
218 | | -.PHONY: claude-beads claude-github setup-claude happy run build root pull-main \ |
219 | | - inside-setup outside-setup install-pat install-ssh-deploy-key gh-auth |
| 245 | +.PHONY: claude-beads claude-github setup-claude happy run build root root-all-ports \ |
| 246 | + web server pull-main inside-setup outside-setup install-pat install-ssh-deploy-key gh-auth |
0 commit comments