Refactor Dockerfile and Update CI Configuration

- Changed the working directory in the Dockerfile to /app for better organization.
- Removed the iat.yaml configuration file to simplify the container setup and reduce complexity.
- Adjusted the exposed port to 80, aligning with standard HTTP practices for the scraper application.
- Updated the CI configuration in .drone.yml to reflect these changes, ensuring a streamlined build process.
This commit is contained in:
n.nakhostin
2025-08-31 17:13:57 +03:30
parent 31cf9a4454
commit e6bf47a769
3 changed files with 6 additions and 36 deletions
+6 -7
View File
@@ -3,21 +3,20 @@ ARG BASH_VERSION=5.0
FROM golang:${GO_VERSION} AS go-builder
WORKDIR /go/src/company/tm_back
WORKDIR /app
COPY . .
COPY cmd/scraper/iat.yaml /go/bin/config.yaml
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
&& ln -s /usr/bin/mail /usr/bin/s-nail
COPY --from=go-builder /go/src/company/tm_back/scraper-build .
WORKDIR /app
EXPOSE 8090
COPY --from=go-builder /app/scraper-build .
EXPOSE 80
ENTRYPOINT /go/bin/scraper-build
-28
View File
@@ -1,28 +0,0 @@
database:
mongodb:
uri: "mongodb://mongo:27017"
name: "tender_management"
timeout: 10s
max_pool_size: 50
logging:
level: "info"
format: "json"
output: "file" # stdout, stderr, file
file:
path: "./logs/scraper.log"
max_size: 100 # Max size in MB before rotation
max_backups: 5 # Number of backup files to keep
max_age: 30 # Max age in days to keep log files
compress: true # Compress rotated files
ted:
base_url: "https://ted.europa.eu/packages/daily"
timeout: 300s # Increased to 5 minutes for large files
max_retries: 5
retry_delay: 10s
user_agent: "TenderManagement-TED-Scraper/1.0"
max_concurrency: 2 # Reduced to avoid overwhelming the server
download_dir: "./ted_downloads"
cleanup_after: 72h
scraping_interval: 12h # Run scraping every 12 hours