-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update S3 crawler Dockerfile to skip library dependencies and add bui…
…ld stamps
- Loading branch information
1 parent
c3105d3
commit 4e07944
Showing
2 changed files
with
21 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# Repo name: arynai/sycamore-crawler-s3 | ||
|
||
# In the root directory: | ||
# docker build -t sycamore_crawler_s3 -f crawler/s3/Dockerfile | ||
# docker run -it -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN sycamore_crawler_s3 | ||
# docker run -it -v crawl_data:/app/.data/.s3 -e AWS_ACCESS_KEY_ID -e AWS_SECRET_ACCESS_KEY -e AWS_SESSION_TOKEN sycamore_crawler_s3 | ||
FROM python:3 | ||
|
||
WORKDIR /app | ||
|
@@ -13,11 +15,24 @@ ENV POETRY_NO_INTERACTION=1 \ | |
POETRY_CACHE_DIR=/tmp/poetry_cache | ||
|
||
COPY pyproject.toml poetry.lock crawler/README.md ./ | ||
RUN poetry install --only main,crawler_s3 --no-root && rm -rf $POETRY_CACHE_DIR | ||
RUN poetry install --only crawler_s3 --no-root && rm -rf $POETRY_CACHE_DIR | ||
|
||
COPY crawler/s3 . | ||
# Hack beccause pyproject.toml expects a sycamore directory | ||
RUN mkdir sycamore && touch sycamore/__init__.py | ||
RUN poetry install --only-root && rm -rf $POETRY_CACHE_DIR | ||
|
||
ARG GIT_BRANCH="main" | ||
ARG GIT_COMMIT="unknown" | ||
ARG GIT_DIFF="unknown" | ||
|
||
ENV GIT_BRANCH=${GIT_BRANCH} | ||
ENV GIT_COMMIT=${GIT_COMMIT} | ||
ENV GIT_DIFF=${GIT_DIFF} | ||
|
||
LABEL org.opencontainers.image.authors="[email protected]" | ||
LABEL git_branch=${GIT_BRANCH} | ||
LABEL git_commit=${GIT_COMMIT} | ||
LABEL git_diff=${GIT_DIFF} | ||
|
||
ENTRYPOINT [ "poetry", "run", "python", "./crawler/s3_crawler.py"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters