Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize the build time of DockerFile #159

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 14 additions & 11 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ ENV PYTHONFAULTHANDLER=1
RUN python -m venv /opt/venv
ENV PATH="/opt/venv/bin:$PATH"

# Get the code
COPY . /taiga-back
WORKDIR /taiga-back

# grab gosu for easy step-down from root
# https://github.com/tianon/gosu/blob/master/INSTALL.md
ENV GOSU_VERSION 1.12
Expand All @@ -38,9 +34,10 @@ RUN set -eux; \
git \
net-tools \
procps \
wget; \
wget;

# install gosu
apt-get install -y --no-install-recommends ca-certificates wget; \
RUN apt-get install -y --no-install-recommends ca-certificates wget; \
dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')"; \
wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch"; \
wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc"; \
Expand All @@ -50,13 +47,19 @@ RUN set -eux; \
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4; \
gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu; \
command -v gpgconf && gpgconf --kill all || :; \
rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc; \
rm -rf "$GNUPGHOME" /usr/local/bin/gosu.asc;

# install Taiga dependencies
python -m pip install --upgrade pip; \
python -m pip install wheel; \
RUN python -m pip install --upgrade pip; \
python -m pip install wheel \
python -m pip install -r requirements.txt; \
python -m pip install -r requirements-contribs.txt; \
python manage.py compilemessages; \
python -m pip install -r requirements-contribs.txt;

# Get the code
COPY . /taiga-back
WORKDIR /taiga-back

RUN python manage.py compilemessages; \
python manage.py collectstatic --no-input; \
chmod +x docker/entrypoint.sh; \
chmod +x docker/async_entrypoint.sh; \
Expand Down