dockerized

This commit is contained in:
liyunze 2026-01-03 22:11:04 +08:00
parent 17fa355ecb
commit b5d87d2aaf
3 changed files with 22 additions and 0 deletions

5
.dockerignore Normal file
View file

@ -0,0 +1,5 @@
/target
/.git
/.vscode
bot_data.sqlite
*.sqlite

12
Dockerfile Normal file
View file

@ -0,0 +1,12 @@
# Build stage
FROM rust:latest AS builder
WORKDIR /usr/src/portfolio-roast-bot
COPY . .
RUN cargo build --release
# Runtime stage
FROM debian:bookworm-slim
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY --from=builder /usr/src/portfolio-roast-bot/target/release/portfolio-roast-bot .
CMD ["./portfolio-roast-bot"]

5
docker-compose.yml Normal file
View file

@ -0,0 +1,5 @@
services:
portfolio_roast_bot:
build: .
env_file:
- .env