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:
@@ -18,7 +18,6 @@ steps:
|
|||||||
- APP_VERSION=$(git rev-list HEAD --count --no-merges)-$DRONE_BRANCH
|
- APP_VERSION=$(git rev-list HEAD --count --no-merges)-$DRONE_BRANCH
|
||||||
- echo "APP Version tags $APP_VERSION"
|
- echo "APP Version tags $APP_VERSION"
|
||||||
- echo -n "$APP_VERSION" >> .tags
|
- echo -n "$APP_VERSION" >> .tags
|
||||||
|
|
||||||
- name: build web
|
- name: build web
|
||||||
image: plugins/docker
|
image: plugins/docker
|
||||||
settings:
|
settings:
|
||||||
|
|||||||
@@ -3,21 +3,20 @@ ARG BASH_VERSION=5.0
|
|||||||
|
|
||||||
FROM golang:${GO_VERSION} AS go-builder
|
FROM golang:${GO_VERSION} AS go-builder
|
||||||
|
|
||||||
WORKDIR /go/src/company/tm_back
|
WORKDIR /app
|
||||||
|
|
||||||
COPY . .
|
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
|
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -v -o scraper-build ./cmd/scraper/main.go
|
||||||
|
|
||||||
FROM bash:${BASH_VERSION}
|
FROM bash:${BASH_VERSION}
|
||||||
RUN apk --no-cache add busybox-suid curl rsync tzdata tcpdump tree ca-certificates s-nail \
|
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 \
|
&& 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 .
|
WORKDIR /app
|
||||||
|
|
||||||
EXPOSE 8090
|
COPY --from=go-builder /app/scraper-build .
|
||||||
|
|
||||||
|
EXPOSE 80
|
||||||
|
|
||||||
ENTRYPOINT /go/bin/scraper-build
|
ENTRYPOINT /go/bin/scraper-build
|
||||||
|
|||||||
@@ -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
|
|
||||||
Reference in New Issue
Block a user