vercel-vm-factory 0.11.8 → 0.15.8
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/README.md +1 -1
- package/deploy-vm.mjs +5 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -78,7 +78,7 @@ Choosing bash or zsh adds the matching package to the generated Dockerfile when
|
|
|
78
78
|
|
|
79
79
|
Generated shell setup examples:
|
|
80
80
|
|
|
81
|
-
- Alpine + `/bin/zsh`: installs `zsh curl git`,
|
|
81
|
+
- Alpine + `/bin/zsh`: installs `zsh curl git`, clones oh-my-zsh into `/root/.oh-my-zsh`, and writes `/root/.zshrc`.
|
|
82
82
|
- Ubuntu/Debian + `/bin/bash`: installs `bash` with `apt-get`.
|
|
83
83
|
- `/bin/sh`: no extra shell package is installed.
|
|
84
84
|
|
package/deploy-vm.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import { spawn } from "node:child_process";
|
|
|
4
4
|
import { stdin as input, stdout as output } from "node:process";
|
|
5
5
|
import { homedir } from "node:os";
|
|
6
6
|
import path from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
7
8
|
import * as p from "@clack/prompts";
|
|
8
9
|
|
|
9
10
|
const defaultWsShellImage = "ghcr.io/v1xingyue/ws-shell:v1.8.alpine";
|
|
@@ -21,7 +22,7 @@ const toolChoices = {
|
|
|
21
22
|
};
|
|
22
23
|
|
|
23
24
|
const { command, args } = parseCommand(process.argv.slice(2));
|
|
24
|
-
const scriptRoot = path.
|
|
25
|
+
const scriptRoot = path.dirname(fileURLToPath(import.meta.url));
|
|
25
26
|
const workspaceRoot = process.cwd();
|
|
26
27
|
const stateRoot = path.join(homedir(), ".vercel-vm-factory");
|
|
27
28
|
const defaultsPath = path.join(stateRoot, "defaults.json");
|
|
@@ -380,7 +381,7 @@ function makeDockerfile({ shell, tools, vmImage, vmImageName, wsShellImage }) {
|
|
|
380
381
|
const shellInstall = makeShellInstall({ shell, vmImageName });
|
|
381
382
|
const ohMyZshInstall =
|
|
382
383
|
path.basename(shell) === "zsh"
|
|
383
|
-
? `RUN
|
|
384
|
+
? `RUN git clone --depth=1 https://github.com/ohmyzsh/ohmyzsh.git /root/.oh-my-zsh \\
|
|
384
385
|
&& printf '%s\\n' \\
|
|
385
386
|
'export ZSH="$HOME/.oh-my-zsh"' \\
|
|
386
387
|
'ZSH_THEME="robbyrussell"' \\
|
|
@@ -397,14 +398,14 @@ ARG VM_IMAGE=${vmImage}
|
|
|
397
398
|
|
|
398
399
|
FROM \${WS_SHELL_IMAGE} AS ws-shell
|
|
399
400
|
FROM \${VM_IMAGE} AS vm
|
|
401
|
+
ENV HOME=/root
|
|
402
|
+
ENV SHELL=${shell}
|
|
400
403
|
${shellSetup ? `\n${shellSetup}\n` : ""}
|
|
401
404
|
# wsterm already embeds the web UI; runtime config comes from environment variables.
|
|
402
405
|
COPY --from=ws-shell /app/bin/wsterm /app/bin/wsterm
|
|
403
406
|
|
|
404
407
|
WORKDIR /app
|
|
405
408
|
ENV ENABLE_SSL=false
|
|
406
|
-
ENV HOME=/root
|
|
407
|
-
ENV SHELL=${shell}
|
|
408
409
|
EXPOSE 80
|
|
409
410
|
CMD ["/app/bin/wsterm","-bind",":80","-fork","${shell}"]
|
|
410
411
|
`;
|