45d2e84fd7
- Added a new Dockerfile for the scraper application located at cmd/scraper/Dockerfile to streamline the build process. - Updated the CI configuration in .drone.yml to correctly build the scraper application with the new Dockerfile. - Refactored the main application entry point to utilize a new bootstrap package for configuration, logging, and MongoDB initialization. - Enhanced the scraper's configuration management by defining a dedicated Config struct for better organization and maintainability.
23 lines
567 B
Docker
23 lines
567 B
Docker
ARG GO_VERSION=1.23
|
|
ARG BASH_VERSION=5.0
|
|
|
|
FROM golang:${GO_VERSION} AS go-builder
|
|
|
|
WORKDIR /go/src/company/tm_back
|
|
|
|
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 \
|
|
&& mkdir -p /go/bin/media /go/bin/log /go/bin/config
|
|
WORKDIR /go/bin
|
|
|
|
COPY --from=go-builder /go/src/company/tm_back/scraper-build .
|
|
|
|
EXPOSE 8090
|
|
|
|
ENTRYPOINT /go/bin/scraper-build
|