feat(build): Start Lysand from CLI in prod

This commit is contained in:
Jesse Wierzbinski 2024-05-13 11:54:51 -10:00
parent 6b83336fa3
commit 25d087a54b
No known key found for this signature in database
2 changed files with 7 additions and 2 deletions

View file

@ -47,4 +47,4 @@ WORKDIR /app
ENV NODE_ENV=production
ENTRYPOINT [ "/bin/sh", "/app/entrypoint.sh" ]
# Run migrations and start the server
CMD [ "start" ]
CMD [ "cli", "start" ]

View file

@ -35,8 +35,13 @@ export default class Start extends BaseCommand<typeof Start> {
const numCPUs = flags["all-threads"] ? os.cpus().length : flags.threads;
// Check if index is a JS or TS file (depending on the environment)
const index = (await Bun.file("index.ts").exists())
? "index.ts"
: "index.js";
for (let i = 0; i < numCPUs; i++) {
const args = ["bun", "index.ts"];
const args = ["bun", index];
if (i !== 0 || flags.silent) {
args.push("--silent");
}