feat: initial commit
This commit is contained in:
15
deploy/Dockerfile
Normal file
15
deploy/Dockerfile
Normal file
@@ -0,0 +1,15 @@
|
||||
# Stage 1: Build
|
||||
FROM golang:1.22-alpine AS builder
|
||||
WORKDIR /build
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
COPY . .
|
||||
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -o /bot ./cmd/bot
|
||||
|
||||
# Stage 2: Runtime
|
||||
FROM alpine:3.19
|
||||
RUN apk add --no-cache ffmpeg ca-certificates tzdata
|
||||
COPY --from=builder /bot /bot
|
||||
RUN adduser -D -u 1001 botuser
|
||||
USER botuser
|
||||
ENTRYPOINT ["/bot"]
|
||||
31
deploy/docker-compose.yml
Normal file
31
deploy/docker-compose.yml
Normal file
@@ -0,0 +1,31 @@
|
||||
services:
|
||||
bot:
|
||||
build:
|
||||
context: ..
|
||||
dockerfile: deploy/Dockerfile
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- TELEGRAM_BOT_TOKEN=${TELEGRAM_BOT_TOKEN}
|
||||
- N8N_BASE_URL=${N8N_BASE_URL}
|
||||
- N8N_AUTH_TOKEN=${N8N_AUTH_TOKEN}
|
||||
- REDIS_URL=redis://redis:6379
|
||||
- OPENAI_API_KEY=${OPENAI_API_KEY}
|
||||
- BOT_MODE=polling
|
||||
- LOG_LEVEL=info
|
||||
depends_on:
|
||||
redis:
|
||||
condition: service_healthy
|
||||
|
||||
redis:
|
||||
image: redis:7-alpine
|
||||
restart: unless-stopped
|
||||
healthcheck:
|
||||
test: ["CMD", "redis-cli", "ping"]
|
||||
interval: 5s
|
||||
timeout: 3s
|
||||
retries: 5
|
||||
volumes:
|
||||
- redis_data:/data
|
||||
|
||||
volumes:
|
||||
redis_data:
|
||||
Reference in New Issue
Block a user