32 lines
538 B
Text
32 lines
538 B
Text
FROM golang:1.22-alpine AS builder
|
|
|
|
ENV GOTOOLCHAIN=auto
|
|
|
|
RUN apk add --no-cache git
|
|
|
|
WORKDIR /app
|
|
|
|
COPY backend/go.mod backend/go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY backend/ ./
|
|
|
|
RUN go mod tidy
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -o /bin/scraper ./cmd/scraper
|
|
|
|
FROM alpine:3.19
|
|
|
|
RUN apk add --no-cache ca-certificates tzdata
|
|
|
|
COPY --from=builder /bin/scraper /bin/scraper
|
|
|
|
ENV DB_HOST=db \
|
|
DB_PORT=5432 \
|
|
DB_NAME=rss \
|
|
DB_USER=rss \
|
|
DB_PASS=rss \
|
|
SCRAPER_SLEEP=60 \
|
|
SCRAPER_BATCH=10
|
|
|
|
ENTRYPOINT ["/bin/scraper"]
|