This reduces final compressed image size in 25%.
RUN useradd discourse -s /bin/bash -m -U &&\
mkdir -p /var/www &&\
cd /var/www &&\
- git clone https://github.com/discourse/discourse.git &&\
+ git clone --depth 1 https://github.com/discourse/discourse.git &&\
cd discourse &&\
git remote set-branches --add origin tests-passed &&\
chown -R discourse:discourse /var/www/discourse &&\
- git clean -f
- git remote set-branches --add origin master
- git pull
- - git fetch origin $version
+ - git remote set-branches origin $version
+ - git fetch --depth 1 origin $version
- git checkout $version
- mkdir -p tmp
- chown discourse:www-data tmp