portta 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.js +77013 -0
- package/dist/documentation.json +1 -0
- package/dist/runtime/.env.example +440 -0
- package/dist/runtime/VERSION +1 -0
- package/dist/runtime/config/traefik/dynamic/auth.example.yaml.disabled +24 -0
- package/dist/runtime/config/traefik/dynamic/local-tls.yaml +11 -0
- package/dist/runtime/config/traefik/dynamic/middlewares.yaml +35 -0
- package/dist/runtime/config/traefik/dynamic/portta-aliases.yaml +9 -0
- package/dist/runtime/config/traefik/dynamic/portta-auth.yaml +19 -0
- package/dist/runtime/config/traefik/dynamic/portta-shares.yaml +10 -0
- package/dist/runtime/config/traefik/dynamic/tcp.yaml +23 -0
- package/dist/runtime/docker/compose/attach/host.yaml +24 -0
- package/dist/runtime/docker/compose/attach/tailscale.yaml +70 -0
- package/dist/runtime/docker/compose/compose.yaml +214 -0
- package/dist/runtime/docker/compose/features/auth-build.yaml +19 -0
- package/dist/runtime/docker/compose/features/auth-dev.yaml +20 -0
- package/dist/runtime/docker/compose/features/cloudflare-tunnel.yaml +69 -0
- package/dist/runtime/docker/compose/features/dashboard-tailscale.yaml +21 -0
- package/dist/runtime/docker/compose/features/dashboard.yaml +21 -0
- package/dist/runtime/docker/compose/features/db.yaml +63 -0
- package/dist/runtime/docker/compose/features/panel-domain.yaml +42 -0
- package/dist/runtime/docker/compose/features/panel-public.yaml +47 -0
- package/dist/runtime/docker/compose/features/panel-webhook.yaml +46 -0
- package/dist/runtime/docker/compose/features/tcp-tailscale.yaml +30 -0
- package/dist/runtime/docker/compose/features/tcp.yaml +40 -0
- package/dist/runtime/docker/compose/features/web-bind.yaml +19 -0
- package/dist/runtime/docker/compose/features/web-build.yaml +21 -0
- package/dist/runtime/docker/compose/features/web-dev.yaml +53 -0
- package/dist/runtime/docker/compose/features/web-vpn.yaml +24 -0
- package/dist/runtime/docker/compose/features/web.yaml +283 -0
- package/dist/runtime/docker/compose/profiles/local-tls.yaml +23 -0
- package/dist/runtime/docker/compose/profiles/local.yaml +15 -0
- package/dist/runtime/docker/compose/profiles/public.yaml +19 -0
- package/dist/runtime/docker/compose/profiles/remote-tls-dns.yaml +26 -0
- package/dist/runtime/docker/compose/profiles/remote-tls-http.yaml +32 -0
- package/dist/runtime/docker/compose/profiles/remote-tls.yaml +31 -0
- package/dist/runtime/docker/compose/profiles/remote.yaml +23 -0
- package/dist/runtime/docker/images/README.md +12 -0
- package/dist/runtime/docker/images/apply/Dockerfile +45 -0
- package/dist/runtime/docker/images/toolbox/Dockerfile +38 -0
- package/dist/runtime/scripts/lib/runner-exec.sh +189 -0
- package/dist/runtime/templates/README.md +43 -0
- package/dist/runtime/templates/overlays/01-single-web.yaml +23 -0
- package/dist/runtime/templates/overlays/02-web-api.yaml +30 -0
- package/dist/runtime/templates/overlays/03-web-api-postgres.yaml +33 -0
- package/dist/runtime/templates/overlays/04-web-api-postgres-redis.yaml +30 -0
- package/dist/runtime/templates/overlays/05-multiple-apis.yaml +37 -0
- package/dist/runtime/templates/overlays/06-monorepo.yaml +63 -0
- package/dist/runtime/templates/overlays/07-worktree.env +47 -0
- package/dist/runtime/templates/overlays/08-nonstandard-port.yaml +41 -0
- package/dist/runtime/templates/overlays/09-tcp-routing.yaml +70 -0
- package/dist/runtime/templates/overlays/10-mailpit.yaml +24 -0
- package/dist/runtime/templates/overlays/11-rustfs.yaml +25 -0
- package/dist/runtime/templates/project/PORTTA.md +107 -0
- package/package.json +53 -0
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
# Running this project on Portta
|
|
2
|
+
|
|
3
|
+
> Copy this file into the project and adjust the names. It covers only what
|
|
4
|
+
> someone working on *this* project needs. The rules themselves live in the Dev
|
|
5
|
+
> Gateway repository, which stays the single source of truth.
|
|
6
|
+
|
|
7
|
+
## Prerequisites
|
|
8
|
+
|
|
9
|
+
Portta must be running on this machine:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
portta status # if this fails: portta bootstrap && portta up local
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Starting
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
docker compose -f compose.yaml -f compose.portta.yaml up -d
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Set `COMPOSE_FILE=compose.yaml:compose.portta.yaml` in `.env` to drop the
|
|
22
|
+
`-f` flags.
|
|
23
|
+
|
|
24
|
+
## Namespace
|
|
25
|
+
|
|
26
|
+
`COMPOSE_PROJECT_NAME` is what keeps this environment separate from every other
|
|
27
|
+
one on the host: containers, network, volumes and hostnames all derive from it.
|
|
28
|
+
|
|
29
|
+
```env
|
|
30
|
+
# .env
|
|
31
|
+
COMPOSE_PROJECT_NAME=<project>
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## URLs
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
portta urls --project <project>
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
| Service | URL |
|
|
41
|
+
|---|---|
|
|
42
|
+
| web | `http://<project>-web.localhost` |
|
|
43
|
+
| api | `http://<project>-api.localhost` |
|
|
44
|
+
|
|
45
|
+
No port numbers, and no host port is published for either.
|
|
46
|
+
|
|
47
|
+
## Database and cache
|
|
48
|
+
|
|
49
|
+
Not published on the host. Two ways in:
|
|
50
|
+
|
|
51
|
+
**From inside the project**, with nothing to open and nothing to close:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
docker compose exec postgres psql -U <user> -d <db>
|
|
55
|
+
docker compose exec redis redis-cli
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**From a GUI on the host**, through a temporary loopback bridge on a free port:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
portta access open --project <project> --service postgres
|
|
62
|
+
# -> 127.0.0.1:55431
|
|
63
|
+
|
|
64
|
+
portta access list
|
|
65
|
+
portta access close --project <project>
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
Point TablePlus, DBeaver or DataGrip at `127.0.0.1` and the port it printed.
|
|
69
|
+
Credentials are this project's, from its own `.env`.
|
|
70
|
+
|
|
71
|
+
## Working on two branches at once
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
git worktree add ../<project>-issue59 issue59
|
|
75
|
+
cd ../<project>-issue59
|
|
76
|
+
echo "COMPOSE_PROJECT_NAME=<project>-issue59" >> .env
|
|
77
|
+
docker compose -f compose.yaml -f compose.portta.yaml up -d
|
|
78
|
+
# -> http://<project>-issue59-web.localhost
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Both run at once, each with its own database. The first environment is not
|
|
82
|
+
affected.
|
|
83
|
+
|
|
84
|
+
## Troubleshooting
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
portta doctor
|
|
88
|
+
portta urls --project <project>
|
|
89
|
+
docker compose logs -f
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
**404**: the service did not opt in, or Traefik has not discovered it yet.
|
|
93
|
+
**502**: the route matched but the backend did not answer, usually the wrong
|
|
94
|
+
port in the overlay, or the service is not on the `portta` network.
|
|
95
|
+
|
|
96
|
+
More: Portta's `docs/product/guides/troubleshooting.md`.
|
|
97
|
+
|
|
98
|
+
## Without the gateway
|
|
99
|
+
|
|
100
|
+
The overlay only adds networks and labels, so the project still runs on its own:
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
docker compose up -d
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
You lose hostname routing, so you will need published ports. Put those in your
|
|
107
|
+
personal `compose.override.yaml`, not in the shared files.
|
package/package.json
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "portta",
|
|
3
|
+
"version": "0.8.0",
|
|
4
|
+
"description": "Machine-first CLI for a shared Docker development gateway",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"portta": "dist/cli.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist"
|
|
12
|
+
],
|
|
13
|
+
"publishConfig": {
|
|
14
|
+
"access": "public",
|
|
15
|
+
"registry": "https://registry.npmjs.org/"
|
|
16
|
+
},
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "node --import tsx scripts/build.mjs",
|
|
19
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
20
|
+
"test": "vitest run",
|
|
21
|
+
"prepack": "npm run build",
|
|
22
|
+
"prepublishOnly": "npm run typecheck && npm test",
|
|
23
|
+
"preversion": "node scripts/git-version.mjs check",
|
|
24
|
+
"version": "node scripts/git-version.mjs sync",
|
|
25
|
+
"postversion": "node scripts/git-version.mjs verify"
|
|
26
|
+
},
|
|
27
|
+
"engines": {
|
|
28
|
+
"node": ">=22.12.0"
|
|
29
|
+
},
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "git+https://github.com/fabioassuncao/portta.git",
|
|
33
|
+
"directory": "packages/cli"
|
|
34
|
+
},
|
|
35
|
+
"homepage": "https://github.com/fabioassuncao/portta#readme",
|
|
36
|
+
"bugs": "https://github.com/fabioassuncao/portta/issues",
|
|
37
|
+
"dependencies": {
|
|
38
|
+
"@modelcontextprotocol/sdk": "^1.30.0",
|
|
39
|
+
"commander": "14.0.2",
|
|
40
|
+
"execa": "9.6.1",
|
|
41
|
+
"systeminformation": "^5.33.8",
|
|
42
|
+
"zod": "4.5.4"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@types/node": "24.13.3",
|
|
46
|
+
"esbuild": "0.28.2",
|
|
47
|
+
"portta-contracts": "0.1.0",
|
|
48
|
+
"portta-core": "0.1.0",
|
|
49
|
+
"typescript": "7.0.2",
|
|
50
|
+
"vitest": "4.1.11",
|
|
51
|
+
"tsx": "4.23.13"
|
|
52
|
+
}
|
|
53
|
+
}
|