From 5f20c1f86b34e7881e5f4ca6ba449dde69d971a3 Mon Sep 17 00:00:00 2001 From: diogotito Date: Sat, 24 Sep 2022 15:15:13 +0100 Subject: [PATCH] Reorganize Dockerfile to cache apt and pip steps This way, the RUN step that installs @bitwarden/cli gets cached and only needs to be run once per machine Likewise for the RUN step that installs pykeepass, which only needs to be run when the pykeepass version gets bumped --- .dockerignore | 1 + .gitignore | 2 ++ Dockerfile | 11 +++++++---- 3 files changed, 10 insertions(+), 4 deletions(-) create mode 100644 .dockerignore create mode 100644 .gitignore diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..eba74f4 --- /dev/null +++ b/.dockerignore @@ -0,0 +1 @@ +venv/ \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3db16cb --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +venv/ +exports/ \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index dc64d95..eaca213 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,12 @@ FROM python:3.10-slim-bullseye -WORKDIR /bitwarden-to-keepass -COPY . . - RUN apt update && apt install -y npm && \ - pip install -r requirements.txt && \ npm i -g @bitwarden/cli && \ apt purge -y npm + +WORKDIR /bitwarden-to-keepass + +COPY requirements.txt requirements.txt +RUN pip install -r requirements.txt + +COPY . . \ No newline at end of file