diff --git a/.travis.yml b/.travis.yml index 307f80cd..cf67476f 100644 --- a/.travis.yml +++ b/.travis.yml @@ -30,7 +30,7 @@ before_install: fi install: - - pip install mkdocs==1.1 mkdocs-material==4.6.3 + - pip install --no-cache-dir mkdocs==1.1 mkdocs-material==4.6.3 script: - docker build --target=builder --tag=doccano-test . diff --git a/Dockerfile b/Dockerfile index db69bde4..0638fc6e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,8 +21,8 @@ WORKDIR /doccano/app/server/static RUN npm ci COPY requirements.txt / -RUN pip install -r /requirements.txt \ - && pip wheel -r /requirements.txt -w /deps +RUN pip install --no-cache-dir -r /requirements.txt \ + && pip wheel --no-cache-dir -r /requirements.txt -w /deps COPY Dockerfile / RUN hadolint /Dockerfile diff --git a/app/Dockerfile b/app/Dockerfile index 9af1b4fc..add30d71 100644 --- a/app/Dockerfile +++ b/app/Dockerfile @@ -9,9 +9,8 @@ ENV PYTHONUNBUFFERED 1 COPY . /app/ -RUN apk add -U bash python3 python3-dev libpq postgresql-dev unixodbc-dev musl-dev g++ libffi-dev \ - && pip3 install --upgrade pip setuptools \ +RUN apk add -U --no-cache bash python3 python3-dev libpq postgresql-dev unixodbc-dev musl-dev g++ libffi-dev \ + && pip3 install --upgrade --no-cache-dir pip setuptools \ && pip3 install --no-cache-dir -r requirements.txt \ && ln -s /usr/bin/python3 /usr/bin/python \ - && apk del python3-dev postgresql-dev unixodbc-dev musl-dev g++ libffi-dev - + && apk del --no-cache python3-dev postgresql-dev unixodbc-dev musl-dev g++ libffi-dev diff --git a/app/tools/dev-django.sh b/app/tools/dev-django.sh index 384795c2..d7df8c3c 100755 --- a/app/tools/dev-django.sh +++ b/app/tools/dev-django.sh @@ -10,12 +10,12 @@ if [[ ! -f "${venv}/bin/python" ]]; then echo "Creating virtualenv" mkdir -p "${venv}" python3 -m venv "${venv}" - "${venv}/bin/pip" install --upgrade pip setuptools + "${venv}/bin/pip" install --upgrade --no-cache-dir pip setuptools fi echo "Installing dependencies" apt-get update && apt-get install -y g++ unixodbc-dev # pyodbc build dependencies -"${venv}/bin/pip" install -r "${app}/requirements.txt" +"${venv}/bin/pip" install --no-cache-dir -r "${app}/requirements.txt" echo "Initializing database" "${venv}/bin/python" "${app}/manage.py" wait_for_db diff --git a/frontend/Dockerfile b/frontend/Dockerfile index 66e68674..e68d9dc7 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -4,8 +4,8 @@ WORKDIR /app COPY . /app/ -RUN apk add -U git python3 make g++ \ +RUN apk add -U --no-cache git python3 make g++ \ && npm install -g npm@latest \ && npm install \ && npm run build \ - && apk del git make g++ + && apk del --no-cache git make g++ diff --git a/tools/dev-django.sh b/tools/dev-django.sh index b953fd75..16669cea 100755 --- a/tools/dev-django.sh +++ b/tools/dev-django.sh @@ -10,12 +10,12 @@ if [[ ! -f "${venv}/bin/python" ]]; then echo "Creating virtualenv" mkdir -p "${venv}" python3 -m venv "${venv}" - "${venv}/bin/pip" install --upgrade pip setuptools + "${venv}/bin/pip" install --upgrade --no-cache-dir pip setuptools fi echo "Installing dependencies" apt-get update && apt-get install -y g++ unixodbc-dev # pyodbc build dependencies -"${venv}/bin/pip" install -r "${root}/requirements.txt" +"${venv}/bin/pip" install --no-cache-dir -r "${root}/requirements.txt" echo "Initializing database" "${venv}/bin/python" "${app}/manage.py" wait_for_db