- Added PostgreSQL service to docker-compose.yml with health checks and persistent storage. - Updated bot service to use environment variable substitution for database connection string. - Upgraded Go version in Dockerfile to 1.26.1-alpine. - Modified config loading to ignore missing .env file for better compatibility with Docker.
22 lines
325 B
Docker
22 lines
325 B
Docker
# Build stage
|
|
FROM golang:1.26.1-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -o /velox-bot .
|
|
|
|
# Run stage
|
|
FROM alpine:3.19
|
|
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=builder /velox-bot .
|
|
|
|
ENTRYPOINT ["./velox-bot"]
|