@cloudgrid-io/cli 0.3.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/index.d.ts +2 -0
- package/dist/index.js +2094 -0
- package/dist/index.js.map +1 -0
- package/package.json +43 -0
- package/shared-services.yaml +14 -0
- package/templates/CLOUDGRID.md +94 -0
- package/templates/dockerfiles/cron.Dockerfile +7 -0
- package/templates/dockerfiles/nextjs.Dockerfile +17 -0
- package/templates/dockerfiles/node.Dockerfile +8 -0
- package/templates/dockerfiles/python.Dockerfile +8 -0
- package/templates/dockerfiles/static.Dockerfile +4 -0
- package/templates/dockerfiles/static.nginx.conf +12 -0
- package/templates/dockerfiles/typescript.Dockerfile +10 -0
- package/templates/samples/full-stack.yaml +11 -0
- package/templates/samples/multi-service.yaml +14 -0
- package/templates/samples/node-api.yaml +7 -0
- package/templates/samples/python-worker.yaml +9 -0
- package/templates/samples/static-site.yaml +5 -0
- package/templates/stubs/cron.stub.js +14 -0
- package/templates/stubs/cron.stub.package.json +9 -0
- package/templates/stubs/nextjs.stub/next.config.js +5 -0
- package/templates/stubs/nextjs.stub/package.json +15 -0
- package/templates/stubs/nextjs.stub/src/app/health/route.js +3 -0
- package/templates/stubs/nextjs.stub/src/app/layout.js +4 -0
- package/templates/stubs/nextjs.stub/src/app/page.js +3 -0
- package/templates/stubs/node.stub.js +13 -0
- package/templates/stubs/node.stub.package.json +12 -0
- package/templates/stubs/python.stub.py +16 -0
- package/templates/stubs/python.stub.requirements.txt +2 -0
- package/templates/stubs/static.stub/index.html +8 -0
- package/templates/stubs/typescript.stub.package.json +19 -0
- package/templates/stubs/typescript.stub.ts +14 -0
- package/templates/stubs/typescript.stub.tsconfig.json +12 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
FROM node:22-alpine
|
|
2
|
+
WORKDIR /app
|
|
3
|
+
COPY package.json package-lock.json* tsconfig.json ./
|
|
4
|
+
RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
|
|
5
|
+
COPY src/ src/
|
|
6
|
+
RUN npm run build
|
|
7
|
+
RUN npm prune --production
|
|
8
|
+
USER node
|
|
9
|
+
EXPOSE 8080
|
|
10
|
+
CMD ["node", "dist/index.js"]
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
async function run() {
|
|
2
|
+
console.log('Job started:', new Date().toISOString());
|
|
3
|
+
|
|
4
|
+
// Your job logic here
|
|
5
|
+
// Access MongoDB via process.env.MONGODB_URL
|
|
6
|
+
// Access Redis via process.env.REDIS_URL
|
|
7
|
+
|
|
8
|
+
console.log('Job completed');
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
run().catch((err) => {
|
|
12
|
+
console.error('Job failed:', err);
|
|
13
|
+
process.exit(1);
|
|
14
|
+
});
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "__APP_NAME__-__SERVICE_NAME__",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"dev": "next dev -p 8080",
|
|
7
|
+
"build": "next build",
|
|
8
|
+
"start": "next start -p 8080"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"next": "^15.0.0",
|
|
12
|
+
"react": "^19.0.0",
|
|
13
|
+
"react-dom": "^19.0.0"
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const express = require('express');
|
|
2
|
+
const app = express();
|
|
3
|
+
const port = process.env.PORT || 8080;
|
|
4
|
+
|
|
5
|
+
app.use(express.json());
|
|
6
|
+
|
|
7
|
+
app.get('/health', (req, res) => res.json({ status: 'ok' }));
|
|
8
|
+
|
|
9
|
+
app.get('/', (req, res) => res.json({ message: 'Hello from __SERVICE_NAME__' }));
|
|
10
|
+
|
|
11
|
+
app.listen(port, '0.0.0.0', () => {
|
|
12
|
+
console.log(`__SERVICE_NAME__ listening on port ${port}`);
|
|
13
|
+
});
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import os
|
|
2
|
+
from flask import Flask, jsonify
|
|
3
|
+
|
|
4
|
+
app = Flask(__name__)
|
|
5
|
+
port = int(os.environ.get('PORT', 8080))
|
|
6
|
+
|
|
7
|
+
@app.route('/health')
|
|
8
|
+
def health():
|
|
9
|
+
return jsonify(status='ok')
|
|
10
|
+
|
|
11
|
+
@app.route('/')
|
|
12
|
+
def index():
|
|
13
|
+
return jsonify(message='Hello from __SERVICE_NAME__')
|
|
14
|
+
|
|
15
|
+
if __name__ == '__main__':
|
|
16
|
+
app.run(host='0.0.0.0', port=port)
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "__APP_NAME__-__SERVICE_NAME__",
|
|
3
|
+
"version": "0.0.1",
|
|
4
|
+
"private": true,
|
|
5
|
+
"scripts": {
|
|
6
|
+
"start": "node dist/index.js",
|
|
7
|
+
"dev": "tsx watch src/index.ts",
|
|
8
|
+
"build": "tsc"
|
|
9
|
+
},
|
|
10
|
+
"dependencies": {
|
|
11
|
+
"express": "^4.21.0"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"typescript": "^5.7.0",
|
|
15
|
+
"tsx": "^4.0.0",
|
|
16
|
+
"@types/express": "^4.17.0",
|
|
17
|
+
"@types/node": "^22.0.0"
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import express from 'express';
|
|
2
|
+
|
|
3
|
+
const app = express();
|
|
4
|
+
const port = process.env.PORT || 8080;
|
|
5
|
+
|
|
6
|
+
app.use(express.json());
|
|
7
|
+
|
|
8
|
+
app.get('/health', (req, res) => res.json({ status: 'ok' }));
|
|
9
|
+
|
|
10
|
+
app.get('/', (req, res) => res.json({ message: 'Hello from __SERVICE_NAME__' }));
|
|
11
|
+
|
|
12
|
+
app.listen(Number(port), '0.0.0.0', () => {
|
|
13
|
+
console.log(`__SERVICE_NAME__ listening on port ${port}`);
|
|
14
|
+
});
|