convert wetty from submodule to normal directory

This commit is contained in:
douboer@gmail.com
2026-03-03 16:07:18 +08:00
parent 1db76701a6
commit 0d185d2b3c
131 changed files with 15543 additions and 1 deletions

View File

@@ -0,0 +1,35 @@
version: '2'
# Sample docker compose file to demonstrate the usage of wetty behind a reverse
# proxy, optionally with Let's Encrypt based SSL certificate
#
# For SSL support, uncomment the commented lines. Consult traefik documentation
# for features like automatic forward from HTTP to HTTPS etc.
services:
wetty:
image: wettyoss/wetty
command:
- --base=/
- --ssh-host=ssh.example.com
labels:
- "traefik.enable=true"
- "traefik.http.routers.wetty.rule=Host(`wetty.example.com`)"
# - "traefik.http.routers.wetty.tls.certResolver=default"
# - "traefik.http.routers.wetty.tls=true"
reverse-proxy:
image: traefik
command:
- --providers.docker
- --entryPoints.web.address=:80
# - --entryPoints.websecure.address=:443
# - --certificatesResolvers.default.acme.email=your-email@example.com
# - --certificatesResolvers.default.acme.storage=acme.json
# - --certificatesResolvers.default.acme.httpChallenge.entryPoint=web
ports:
- "80:80"
# - "443:443"
volumes:
- /var/run/docker.sock:/var/run/docker.sock

View File

@@ -0,0 +1,3 @@
FROM sickp/alpine-sshd:latest
RUN adduser -D -h /home/term -s /bin/sh term && \
( echo "term:term" | chpasswd )

View File

@@ -0,0 +1,37 @@
# ---------- Base image ----------
FROM node:20-alpine as base
RUN apk add -U build-base python3 py3-setuptools make g++ git
WORKDIR /usr/src/app
# Install pnpm globally
RUN npm install -g pnpm@latest
COPY . /usr/src/app
# ---------- Production dependencies ----------
FROM base AS prod-deps
RUN --mount=type=cache,id=pnpm,target=/root/.pnpm-store pnpm install --prod --frozen-lockfile --ignore-scripts
# Rebuild only the native modules we need
RUN cd node_modules/node-pty && npm run install && cd ../..
RUN cd node_modules/.pnpm/gc-stats@1.4.1/node_modules/gc-stats && npm run install
# ---------- Build stage ----------
FROM base AS build
RUN --mount=type=cache,id=pnpm,target=/root/.pnpm-store pnpm install --frozen-lockfile
RUN pnpm run build
# ---------- Final runtime image ----------
FROM base
LABEL maintainer="butlerx@notthe.cloud"
WORKDIR /usr/src/app
ENV NODE_ENV=production
COPY --from=prod-deps /usr/src/app/node_modules /usr/src/app/node_modules
COPY --from=build /usr/src/app/build /usr/src/app/build
COPY package.json /usr/src/app
RUN apk add -U coreutils openssh-client sshpass && \
mkdir -p ~/.ssh
EXPOSE 3000
CMD ["pnpm", "start"]