Enhance Scraper Dockerfile and Notice Entity
- Added an entrypoint script to the scraper Dockerfile to handle one-time scraping with date range support. - Introduced a new ContentXML field in the Notice entity to store XML content, improving data structure for notices. - Updated the scraper logic to map XML content to the tender entity, enhancing data processing capabilities.
This commit is contained in:
+11
-1
@@ -17,6 +17,16 @@ WORKDIR /app
|
||||
|
||||
COPY --from=go-builder /app/scraper-build .
|
||||
|
||||
# Create entrypoint script
|
||||
RUN echo '#!/bin/bash' > /app/entrypoint.sh && \
|
||||
echo 'set -e' >> /app/entrypoint.sh && \
|
||||
echo 'if [ "$SCRAPER_ONETIME" = "true" ] && [ -n "$FROM_DATE" ] && [ -n "$TO_DATE" ]; then' >> /app/entrypoint.sh && \
|
||||
echo ' exec /app/scraper-build -onetime -from "$FROM_DATE" -to "$TO_DATE"' >> /app/entrypoint.sh && \
|
||||
echo 'else' >> /app/entrypoint.sh && \
|
||||
echo ' exec /app/scraper-build' >> /app/entrypoint.sh && \
|
||||
echo 'fi' >> /app/entrypoint.sh && \
|
||||
chmod +x /app/entrypoint.sh
|
||||
|
||||
EXPOSE 80
|
||||
|
||||
ENTRYPOINT /app/scraper-build
|
||||
ENTRYPOINT ["/app/entrypoint.sh"]
|
||||
|
||||
Reference in New Issue
Block a user