Skip to content

Commit 4dae1c4

Browse files
committed
feat: add Docker deployment support
1 parent 205f86a commit 4dae1c4

3 files changed

Lines changed: 40 additions & 0 deletions

File tree

.dockerignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
node_modules/
2+
dist/
3+
data/
4+
.git/
5+
.gitignore
6+
*.md
7+
.env
8+
.env.example
9+
config.yaml
10+
config.json
11+
config.yml
12+
config.toml
13+
wrangler.jsonc

Dockerfile

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
FROM oven/bun:latest AS builder
2+
WORKDIR /app
3+
COPY package.json bun.lock ./
4+
RUN bun install --frozen-lockfile
5+
COPY . .
6+
RUN bun run build
7+
8+
FROM oven/bun:slim AS runner
9+
WORKDIR /app
10+
COPY --from=builder /app/dist ./dist
11+
COPY --from=builder /app/node_modules ./node_modules
12+
COPY --from=builder /app/package.json ./
13+
EXPOSE 3000
14+
VOLUME ["/app/data"]
15+
CMD ["bun", "run", "start"]

docker-compose.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
services:
2+
shit-bot:
3+
build: .
4+
container_name: shit-bot
5+
restart: unless-stopped
6+
ports:
7+
- "3000:3000"
8+
volumes:
9+
- ./config.yaml:/app/config.yaml:ro
10+
- ./data:/app/data
11+
environment:
12+
- TZ=Asia/Shanghai

0 commit comments

Comments
 (0)