This repository was archived by the owner on May 17, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- FROM debian:12-slim as builder
1+ FROM oven/bun:1.2.2-debian AS builder
22
33WORKDIR /app
44
5- RUN apt update
6- RUN apt install curl unzip -y
7-
8- RUN curl https://bun.sh/install | bash
9-
105COPY package.json .
116COPY bun.lockb .
127
13- RUN /root/.bun/bin/bun install
14-
15- # ? -------------------------
8+ RUN bun install
169
17- FROM gcr.io/distroless/base-debian12
10+ COPY ./src ./src
1811
19- WORKDIR /app
12+ ENV NODE_ENV=production
13+ RUN bun build \
14+ --compile \
15+ --minify-whitespace \
16+ --minify-syntax \
17+ --target bun \
18+ --outfile server \
19+ ./src/index.ts
2020
21- COPY --from=builder /root/.bun/bin/bun bun
22- COPY --from=builder /app/node_modules node_modules
21+ # ? -------------------------
2322
24- COPY src src
23+ FROM debian:12-slim AS runner
2524
26- ENV ENV production
27- ENV PORT 3000
28- CMD ["./bun" , "src/index.ts" ]
25+ WORKDIR /app
26+ COPY --from=builder /app/server server
2927
28+ ENV TZ=Asia/Bangkok
29+ ENV NODE_ENV=production
30+ ENV PORT=3000
3031EXPOSE 3000
32+
33+ CMD ["./server" ]
Original file line number Diff line number Diff line change 77 "dev" : " bun run --hot src/index.ts"
88 },
99 "dependencies" : {
10- "@bogeychan/elysia-logger" : " 0.0.22" ,
11- "@elysiajs/cors" : " 1.0.2" ,
12- "@elysiajs/swagger" : " 1.0.5" ,
13- "cheerio" : " 1.0.0-rc.12" ,
14- "elysia" : " 1.0.24" ,
15- "elysia-rate-limit" : " 3.2.2"
10+ "@bogeychan/elysia-logger" : " 0.1.8" ,
11+ "@elysiajs/cors" : " 1.2.0" ,
12+ "@elysiajs/swagger" : " 1.2.0" ,
13+ "cheerio" : " 1.0.0" ,
14+ "elysia" : " 1.2.11"
1615 },
1716 "devDependencies" : {
1817 "bun-types" : " 1.1.13"
Original file line number Diff line number Diff line change 11import { Elysia , t } from 'elysia'
22import { cors } from '@elysiajs/cors'
33import { swagger } from '@elysiajs/swagger'
4- import { rateLimit } from 'elysia-rate-limit'
54import { logger } from '@bogeychan/elysia-logger'
65
76import { getList } from './functions/getList'
@@ -10,19 +9,6 @@ import { model } from './models'
109
1110const app = new Elysia ( )
1211 . use ( cors ( ) )
13- /** .use(
14- rateLimit({
15- duration: 60 * 60 * 1000, // 1 hour
16- max: 500, // 500 req per hour
17- generator: (req, server) => {
18- return (
19- req.headers.get('CF-Connecting-IP') ??
20- server?.requestIP(req)?.address ??
21- ''
22- )
23- },
24- })
25- ) */
2612 . use (
2713 swagger ( {
2814 exclude : [ '/' , '/ping' ] ,
You can’t perform that action at this time.
0 commit comments