feat(streamer): scaffold package, tsconfig, dockerfile
This commit is contained in:
parent
08f3f6e7da
commit
cc1f278fb8
7 changed files with 4440 additions and 0 deletions
4
.gitignore
vendored
4
.gitignore
vendored
|
|
@ -16,6 +16,10 @@ config/icecast.xml
|
|||
# runtime data
|
||||
data/
|
||||
|
||||
# streamer build artifacts
|
||||
streamer/node_modules/
|
||||
streamer/dist/
|
||||
|
||||
# OS junk
|
||||
.DS_Store
|
||||
Thumbs.db
|
||||
|
|
|
|||
5
streamer/.dockerignore
Normal file
5
streamer/.dockerignore
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
node_modules
|
||||
dist
|
||||
tests
|
||||
*.test.ts
|
||||
.vitest
|
||||
30
streamer/Dockerfile
Normal file
30
streamer/Dockerfile
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
FROM node:22-bookworm-slim AS build
|
||||
WORKDIR /app
|
||||
COPY package.json ./
|
||||
RUN npm install --no-audit --no-fund
|
||||
COPY tsconfig.json ./
|
||||
COPY src ./src
|
||||
RUN npm run build
|
||||
|
||||
FROM node:22-bookworm-slim
|
||||
ENV NODE_ENV=production \
|
||||
DEBIAN_FRONTEND=noninteractive \
|
||||
PUPPETEER_EXECUTABLE_PATH=/usr/bin/chromium
|
||||
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
chromium \
|
||||
ffmpeg \
|
||||
fonts-noto-cjk \
|
||||
fonts-vt323 \
|
||||
ca-certificates \
|
||||
tini \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
WORKDIR /app
|
||||
COPY package.json ./
|
||||
RUN npm install --omit=dev --no-audit --no-fund
|
||||
COPY --from=build /app/dist ./dist
|
||||
|
||||
ENTRYPOINT ["/usr/bin/tini", "--"]
|
||||
CMD ["node", "dist/index.js"]
|
||||
4344
streamer/package-lock.json
generated
Normal file
4344
streamer/package-lock.json
generated
Normal file
File diff suppressed because it is too large
Load diff
30
streamer/package.json
Normal file
30
streamer/package.json
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
{
|
||||
"name": "denpa-streamer",
|
||||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build:views": "node --experimental-strip-types src/views/build.ts",
|
||||
"build:server": "tsc -p tsconfig.json",
|
||||
"build": "npm run build:views && npm run build:server",
|
||||
"start": "node dist/index.js",
|
||||
"test": "vitest run",
|
||||
"test:watch": "vitest",
|
||||
"lint": "eslint src tests"
|
||||
},
|
||||
"dependencies": {
|
||||
"puppeteer-core": "^23.0.0",
|
||||
"react": "^18.3.1",
|
||||
"react-dom": "^18.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^25.6.0",
|
||||
"@types/react": "^18.3.0",
|
||||
"@types/react-dom": "^18.3.0",
|
||||
"esbuild": "^0.24.0",
|
||||
"eslint": "^9.0.0",
|
||||
"typescript": "^5.9.3",
|
||||
"typescript-eslint": "^8.0.0",
|
||||
"vitest": "^2.0.0"
|
||||
}
|
||||
}
|
||||
19
streamer/tsconfig.json
Normal file
19
streamer/tsconfig.json
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"compilerOptions": {
|
||||
"target": "ES2023",
|
||||
"module": "ES2022",
|
||||
"moduleResolution": "bundler",
|
||||
"lib": ["ES2023", "DOM"],
|
||||
"jsx": "react-jsx",
|
||||
"strict": true,
|
||||
"noImplicitAny": true,
|
||||
"noUncheckedIndexedAccess": true,
|
||||
"esModuleInterop": true,
|
||||
"skipLibCheck": true,
|
||||
"outDir": "dist",
|
||||
"rootDir": "src",
|
||||
"declaration": false
|
||||
},
|
||||
"include": ["src/**/*.ts", "src/**/*.tsx"],
|
||||
"exclude": ["src/views/**/*", "node_modules", "dist"]
|
||||
}
|
||||
8
streamer/vitest.config.ts
Normal file
8
streamer/vitest.config.ts
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
import { defineConfig } from "vitest/config";
|
||||
|
||||
export default defineConfig({
|
||||
test: {
|
||||
include: ["tests/**/*.test.ts"],
|
||||
environment: "node",
|
||||
},
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue