dokku-compose 0.2.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/LICENSE +21 -0
- package/README.md +555 -0
- package/bin/dokku-compose +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +965 -0
- package/dist/init-GIXEVLNW.js +31 -0
- package/dist/ps-33II4UU3.js +20 -0
- package/package.json +52 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// src/commands/init.ts
|
|
2
|
+
import * as fs from "fs";
|
|
3
|
+
var STARTER_YAML = `# dokku-compose.yml \u2014 generated by dokku-compose init
|
|
4
|
+
plugins:
|
|
5
|
+
postgres:
|
|
6
|
+
url: https://github.com/dokku/dokku-postgres.git
|
|
7
|
+
|
|
8
|
+
services:
|
|
9
|
+
myapp-postgres:
|
|
10
|
+
plugin: postgres
|
|
11
|
+
|
|
12
|
+
apps:
|
|
13
|
+
myapp:
|
|
14
|
+
ports:
|
|
15
|
+
- "http:80:3000"
|
|
16
|
+
links:
|
|
17
|
+
- myapp-postgres
|
|
18
|
+
env:
|
|
19
|
+
NODE_ENV: production
|
|
20
|
+
`;
|
|
21
|
+
function runInit(filePath, _apps) {
|
|
22
|
+
if (fs.existsSync(filePath)) {
|
|
23
|
+
console.error(`File already exists: ${filePath}`);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
fs.writeFileSync(filePath, STARTER_YAML);
|
|
27
|
+
console.log(`Created ${filePath}`);
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
runInit
|
|
31
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// src/commands/ps.ts
|
|
2
|
+
async function runPs(runner, config, appFilter) {
|
|
3
|
+
const apps = appFilter.length > 0 ? appFilter : Object.keys(config.apps);
|
|
4
|
+
for (const app of apps) {
|
|
5
|
+
const exists = await runner.check("apps:exists", app);
|
|
6
|
+
if (!exists) {
|
|
7
|
+
console.log(`${app}: not deployed`);
|
|
8
|
+
continue;
|
|
9
|
+
}
|
|
10
|
+
const report = await runner.query("ps:report", app);
|
|
11
|
+
console.log(`${app}:`);
|
|
12
|
+
for (const line of report.split("\n")) {
|
|
13
|
+
const trimmed = line.trim();
|
|
14
|
+
if (trimmed) console.log(` ${trimmed}`);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
export {
|
|
19
|
+
runPs
|
|
20
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "dokku-compose",
|
|
3
|
+
"version": "0.2.0",
|
|
4
|
+
"description": "Docker Compose for Dokku — declare your entire server in a single YAML file.",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"exports": "./dist/index.js",
|
|
7
|
+
"bin": {
|
|
8
|
+
"dokku-compose": "./dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist/",
|
|
12
|
+
"bin/"
|
|
13
|
+
],
|
|
14
|
+
"type": "module",
|
|
15
|
+
"engines": {
|
|
16
|
+
"node": ">=18"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"test": "bun test",
|
|
20
|
+
"test:watch": "bun test --watch",
|
|
21
|
+
"build": "tsup src/index.ts --format esm --dts",
|
|
22
|
+
"dev": "bun src/index.ts"
|
|
23
|
+
},
|
|
24
|
+
"keywords": [
|
|
25
|
+
"dokku",
|
|
26
|
+
"deploy",
|
|
27
|
+
"devops",
|
|
28
|
+
"infrastructure",
|
|
29
|
+
"declarative"
|
|
30
|
+
],
|
|
31
|
+
"author": "Guess",
|
|
32
|
+
"license": "MIT",
|
|
33
|
+
"repository": {
|
|
34
|
+
"type": "git",
|
|
35
|
+
"url": "https://github.com/guess/dokku-compose.git"
|
|
36
|
+
},
|
|
37
|
+
"homepage": "https://github.com/guess/dokku-compose",
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"chalk": "^5.6.2",
|
|
40
|
+
"commander": "^14.0.3",
|
|
41
|
+
"execa": "^9.6.1",
|
|
42
|
+
"js-yaml": "^4.1.1",
|
|
43
|
+
"zod": "^4.3.6"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@types/js-yaml": "^4.0.9",
|
|
47
|
+
"@types/node": "^25.3.3",
|
|
48
|
+
"tsup": "^8.5.1",
|
|
49
|
+
"typescript": "^5.9.3",
|
|
50
|
+
"vitest": "^4.0.18"
|
|
51
|
+
}
|
|
52
|
+
}
|