mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-01-30 06:12:03 +00:00
update the script to support running in docker
This commit is contained in:
1
.claude/.gitignore
vendored
Normal file
1
.claude/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
hans/
|
||||||
1
.dockerignore
Normal file
1
.dockerignore
Normal file
@@ -0,0 +1 @@
|
|||||||
|
node_modules/
|
||||||
19
init.mjs
19
init.mjs
@@ -516,6 +516,7 @@ async function main() {
|
|||||||
console.log('═══════════════════════════════════════════════════════');
|
console.log('═══════════════════════════════════════════════════════');
|
||||||
console.log(' 1) Web Application (Browser)');
|
console.log(' 1) Web Application (Browser)');
|
||||||
console.log(' 2) Desktop Application (Electron)');
|
console.log(' 2) Desktop Application (Electron)');
|
||||||
|
console.log(' 3) Docker Container');
|
||||||
console.log('═══════════════════════════════════════════════════════');
|
console.log('═══════════════════════════════════════════════════════');
|
||||||
console.log('');
|
console.log('');
|
||||||
|
|
||||||
@@ -533,7 +534,7 @@ async function main() {
|
|||||||
|
|
||||||
// Prompt for choice
|
// Prompt for choice
|
||||||
while (true) {
|
while (true) {
|
||||||
const choice = await prompt('Enter your choice (1 or 2): ');
|
const choice = await prompt('Enter your choice (1, 2, or 3): ');
|
||||||
|
|
||||||
if (choice === '1') {
|
if (choice === '1') {
|
||||||
console.log('');
|
console.log('');
|
||||||
@@ -634,9 +635,23 @@ async function main() {
|
|||||||
electronProcess.on('close', resolve);
|
electronProcess.on('close', resolve);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
break;
|
||||||
|
} else if (choice === '3') {
|
||||||
|
console.log('');
|
||||||
|
log('Launching Docker Container...', 'blue');
|
||||||
|
console.log('');
|
||||||
|
|
||||||
|
// Run docker compose up --build via npm run dev:docker
|
||||||
|
const dockerProcess = runNpm(['run', 'dev:docker'], {
|
||||||
|
stdio: 'inherit',
|
||||||
|
});
|
||||||
|
await new Promise((resolve) => {
|
||||||
|
dockerProcess.on('close', resolve);
|
||||||
|
});
|
||||||
|
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
log('Invalid choice. Please enter 1 or 2.', 'red');
|
log('Invalid choice. Please enter 1, 2, or 3.', 'red');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user