f1bdacdc98
- Replaced inline entrypoint script creation in the Dockerfile with a separate entrypoint.sh file for better maintainability and clarity. - The new entrypoint script handles one-time scraping with date range support, improving the scraper's functionality and usability.
27 lines
586 B
Docker
27 lines
586 B
Docker
ARG GO_VERSION=1.23
|
|
ARG BASH_VERSION=5.0
|
|
|
|
FROM golang:${GO_VERSION} AS go-builder
|
|
|
|
WORKDIR /app
|
|
|
|
COPY . .
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o scraper-build ./cmd/scraper/main.go
|
|
|
|
FROM bash:${BASH_VERSION}
|
|
RUN apk --no-cache add busybox-suid curl rsync tzdata tcpdump tree ca-certificates s-nail \
|
|
&& ln -s /usr/bin/mail /usr/bin/s-nail
|
|
|
|
WORKDIR /app
|
|
|
|
COPY --from=go-builder /app/scraper-build .
|
|
|
|
# Copy and set up entrypoint script
|
|
COPY cmd/scraper/entrypoint.sh /app/entrypoint.sh
|
|
RUN chmod +x /app/entrypoint.sh
|
|
|
|
EXPOSE 80
|
|
|
|
ENTRYPOINT ["/app/entrypoint.sh"]
|