Skip to content
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.

Commit

Permalink
⬆️ chore(deps): Update deps (#286)
Browse files Browse the repository at this point in the history
  • Loading branch information
vvatelot authored Jun 19, 2023
1 parent 98b9656 commit c0d8992
Show file tree
Hide file tree
Showing 5 changed files with 1,320 additions and 1,303 deletions.
16 changes: 5 additions & 11 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
dist
__pycache__
.github
.pytest_cache
.venv
.vscode
doc
.coverage
.gitignore
LICENSE
*.csv
*
!ecoindex_cli
!poetry.lock
!pyproject.toml
!README.md
24 changes: 12 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,21 @@ FROM python:3.11-slim as requirements-stage
ARG CHROME_VERSION_MAIN=111

WORKDIR /tmp
COPY ./ ./

# Install required deps
RUN apt update && apt install -y unzip wget
RUN pip install poetry
RUN poetry build

# Build requirements.txt file
COPY ./pyproject.toml ./poetry.lock /tmp/
RUN poetry export --with=worker --output=requirements.txt --without-hashes

# Download chromedriver and chrome
RUN wget "https://chromedriver.storage.googleapis.com/LATEST_RELEASE_${CHROME_VERSION_MAIN}" -O /tmp/chrome_version
RUN wget "https://chromedriver.storage.googleapis.com/$(cat /tmp/chrome_version)/chromedriver_linux64.zip" \
&& unzip chromedriver_linux64.zip
&& unzip -o chromedriver_linux64.zip
RUN wget "https://dl.google.com/linux/chrome/deb/pool/main/g/google-chrome-stable/google-chrome-stable_$(cat /tmp/chrome_version)-1_amd64.deb" \
&& mv "google-chrome-stable_$(cat /tmp/chrome_version)-1_amd64.deb" google-chrome-stable.deb
-O google-chrome-stable.deb

# Build ecoindex-cli
COPY ./ ./
RUN pip install poetry
RUN poetry build

# Main image
FROM python:3.11-slim
Expand All @@ -32,14 +29,17 @@ ENV CHROMEDRIVER_PATH=/usr/bin/chromedriver

WORKDIR /code

# Copy requirements.txt, chromedriver, chrome_version, google-chrome-stable.deb from requirements-stage
# Copy built packages, chromedriver, google-chrome-stable.deb from requirements-stage
COPY --from=requirements-stage /tmp/dist/ /tmp/dist/
COPY --from=requirements-stage /tmp/chromedriver /usr/bin/chromedriver
COPY --from=requirements-stage /tmp/chrome_version /tmp/chrome_version
COPY --from=requirements-stage /tmp/google-chrome-stable.deb /tmp/

# Install google chrome and make chromedriver executable
RUN apt update && apt -y install libpq-dev gcc /tmp/google-chrome-stable.deb
RUN chmod +x /usr/bin/chromedriver

RUN pip install /tmp/dist/*.whl
# Install ecoindex-cli
RUN pip install /tmp/dist/*.whl

# Clean up
RUN rm -rf /tmp/google-chrome-stable.deb /tmp/dist /var/lib/{apt,dpkg,cache,log}/
Binary file added chromedriver
Binary file not shown.
Loading

0 comments on commit c0d8992

Please sign in to comment.