Browse Source

apk and pip: turn off caching

pull/843/head
Alexander Kurakin 4 years ago
parent
commit
1ef215babe
6 changed files with 12 additions and 13 deletions
  1. 2
      .travis.yml
  2. 4
      Dockerfile
  3. 7
      app/Dockerfile
  4. 4
      app/tools/dev-django.sh
  5. 4
      frontend/Dockerfile
  6. 4
      tools/dev-django.sh

2
.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 .

4
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

7
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

4
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

4
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++

4
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

Loading…
Cancel
Save