mirror of
https://github.com/shishantbiswas/bknd.git
synced 2026-03-16 04:27:21 +00:00
hotfix 0.9.1 docker fails due to trying to open a browser
This commit is contained in:
@@ -3,7 +3,7 @@
|
|||||||
"type": "module",
|
"type": "module",
|
||||||
"sideEffects": false,
|
"sideEffects": false,
|
||||||
"bin": "./dist/cli/index.js",
|
"bin": "./dist/cli/index.js",
|
||||||
"version": "0.9.0",
|
"version": "0.9.1",
|
||||||
"description": "Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, Remix, Astro, Cloudflare, Bun, Node, AWS Lambda & more.",
|
"description": "Lightweight Firebase/Supabase alternative built to run anywhere — incl. Next.js, Remix, Astro, Cloudflare, Bun, Node, AWS Lambda & more.",
|
||||||
"homepage": "https://bknd.io",
|
"homepage": "https://bknd.io",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -30,7 +30,11 @@ export async function attachServeStatic(app: any, platform: Platform) {
|
|||||||
app.module.server.client.get(config.server.assets_path + "*", await serveStatic(platform));
|
app.module.server.client.get(config.server.assets_path + "*", await serveStatic(platform));
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function startServer(server: Platform, app: any, options: { port: number }) {
|
export async function startServer(
|
||||||
|
server: Platform,
|
||||||
|
app: any,
|
||||||
|
options: { port: number; open?: boolean },
|
||||||
|
) {
|
||||||
const port = options.port;
|
const port = options.port;
|
||||||
console.log(`Using ${server} serve`);
|
console.log(`Using ${server} serve`);
|
||||||
|
|
||||||
@@ -55,7 +59,9 @@ export async function startServer(server: Platform, app: any, options: { port: n
|
|||||||
|
|
||||||
const url = `http://localhost:${port}`;
|
const url = `http://localhost:${port}`;
|
||||||
console.info("Server listening on", url);
|
console.info("Server listening on", url);
|
||||||
|
if (options.open) {
|
||||||
await open(url);
|
await open(url);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export async function getConfigPath(filePath?: string) {
|
export async function getConfigPath(filePath?: string) {
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ export const run: CliCommand = (program) => {
|
|||||||
.choices(PLATFORMS)
|
.choices(PLATFORMS)
|
||||||
.default(isBun ? "bun" : "node"),
|
.default(isBun ? "bun" : "node"),
|
||||||
)
|
)
|
||||||
|
.addOption(new Option("--no-open", "don't open browser window on start"))
|
||||||
.action(action);
|
.action(action);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -110,6 +111,7 @@ async function action(options: {
|
|||||||
dbUrl?: string;
|
dbUrl?: string;
|
||||||
dbToken?: string;
|
dbToken?: string;
|
||||||
server: Platform;
|
server: Platform;
|
||||||
|
open?: boolean;
|
||||||
}) {
|
}) {
|
||||||
colorizeConsole(console);
|
colorizeConsole(console);
|
||||||
const configFilePath = await getConfigPath(options.config);
|
const configFilePath = await getConfigPath(options.config);
|
||||||
@@ -145,5 +147,5 @@ async function action(options: {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
await startServer(options.server, app, { port: options.port });
|
await startServer(options.server, app, { port: options.port, open: options.open });
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,10 +19,10 @@ RUN npm install @libsql/client
|
|||||||
|
|
||||||
# Create volume and init args
|
# Create volume and init args
|
||||||
VOLUME /data
|
VOLUME /data
|
||||||
ENV DEFAULT_ARGS "--db-url file:/data/data.db"
|
ENV DEFAULT_ARGS="--db-url file:/data/data.db"
|
||||||
|
|
||||||
# Copy output from builder
|
# Copy output from builder
|
||||||
COPY --from=builder /output/dist ./dist
|
COPY --from=builder /output/dist ./dist
|
||||||
|
|
||||||
EXPOSE 1337
|
EXPOSE 1337
|
||||||
CMD ["pm2-runtime", "dist/cli/index.js run ${ARGS:-${DEFAULT_ARGS}}"]
|
CMD ["pm2-runtime", "dist/cli/index.js run ${ARGS:-${DEFAULT_ARGS}} --no-open"]
|
||||||
Reference in New Issue
Block a user