mirror of
https://github.com/linux-odyssey/linux-odyssey.git
synced 2026-11-05 19:20:12 +08:00
feat: init cmd-hook and move terminal-service to services directory
feat: put cmd-hook in container feat: cmd-hook request type, auto restart setup feat: handle ls
This commit is contained in:
1 parent
58b6448c3d
commit
0b08a9a5d9
16 files changed
+343
-21
No files matched your search
@@ -29,7 +29,7 @@ precmd() {
|
||||
export CMD_ERROR_FILE=/tmp/cmd.error
|
||||
|
||||
# Now run your Node.js script with the result as an argument
|
||||
node /usr/local/lib/container/cli.js; rm /tmp/cmd.out /tmp/cmd.error 2>/dev/null
|
||||
/usr/local/bin/cmd-hook; rm /tmp/cmd.out /tmp/cmd.error 2>/dev/null
|
||||
|
||||
# Reset variables
|
||||
unset CMD_START_TIME
|
||||
|
||||
+14
-13
@@ -1,4 +1,16 @@
|
||||
FROM debian:bookworm-slim
|
||||
FROM golang:1.24-alpine as builder
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY ./services/cmd-hook/go.mod ./
|
||||
|
||||
RUN go mod download
|
||||
|
||||
COPY ./services/cmd-hook ./
|
||||
|
||||
RUN go build -o cmd-hook
|
||||
|
||||
FROM debian:bookworm-slim as main
|
||||
|
||||
LABEL maintainer="wancat@wancat.cc"
|
||||
|
||||
@@ -8,18 +20,7 @@ RUN apt-get update && apt-get install -y \
|
||||
curl \
|
||||
openssh-server
|
||||
|
||||
|
||||
RUN curl -fsSL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh
|
||||
RUN bash nodesource_setup.sh
|
||||
RUN apt-get install -y nodejs
|
||||
RUN npm install -g yarn
|
||||
RUN node -v && yarn -v
|
||||
|
||||
WORKDIR /usr/local/lib/container
|
||||
COPY ./packages/container/package.json ./yarn.lock ./
|
||||
RUN yarn install --modules-folder /usr/src/node_modules
|
||||
ENV NODE_PATH=/usr/src/node_modules
|
||||
COPY ./packages/container /usr/local/lib/container
|
||||
COPY --from=builder /app/cmd-hook /usr/local/bin/cmd-hook
|
||||
COPY ./quests/.includes/zshrc /etc/zsh/zshrc
|
||||
RUN rm -f /etc/motd /etc/issue /etc/issue.net /etc/update-motd.d/*
|
||||
RUN rm -rf /etc/skel && mkdir -p /etc/skel
|
||||
|
||||
Reference in new issue
Block a user