Newer
Older
Michał 'rysiek' Woźniak
committed
ENV RAILS_ENV=production \
DISCOURSE_DB_HOST=postgres \
DISCOURSE_REDIS_HOST=redis \
GIFSICLE_VERSION=1.88 \
PNGQUANT_VERSION=2.8.0 \
DISCOURSE_VERSION=1.9.0.beta11 \
BUILD_DEPS="\
libfreetype6-dev \
libjpeg-dev \
libjpeg-turbo-progs \
libtiff-dev"
RUN addgroup --gid 1000 discourse \
&& adduser --system --uid 1000 --ingroup discourse --shell /bin/bash discourse \
&& cd /home/discourse \
&& git clone --branch v${DISCOURSE_VERSION} https://github.com/discourse/discourse.git \
&& sed -i 's/daemonize true/daemonize false/g' ./config/puma.rb \
&& git remote set-branches --add origin tests-passed \
&& curl --silent --location https://deb.nodesource.com/setup_8.x | bash - \
&& apt-get update && apt-get install -y --no-install-recommends \
${BUILD_DEPS} \
jpegoptim \
ghostscript \
gsfonts \
imagemagick \
&& npm install svgo uglify-js@"<3" -g \
&& cd /tmp \
&& curl -O http://www.lcdf.org/gifsicle/gifsicle-$GIFSICLE_VERSION.tar.gz \
&& tar zxf gifsicle-$GIFSICLE_VERSION.tar.gz \
&& cd gifsicle-$GIFSICLE_VERSION \
&& ./configure && make install \
&& cd /tmp \
&& rm gifsicle-$GIFSICLE_VERSION.tar.gz \
&& rm -rf gifsicle-$GIFSICLE_VERSION \
&& git clone -b $PNGQUANT_VERSION --single-branch https://github.com/pornel/pngquant \
&& cd pngquant \
&& make && make install \
&& rm -rf pngquant \
&& cd /home/discourse/discourse \
&& bundle config build.nokogiri --use-system-libraries \
&& bundle install --deployment --without test --without development \
&& apt-get remove -y --purge ${BUILD_DEPS} \