82 lines
2.2 KiB
Plaintext
82 lines
2.2 KiB
Plaintext
IMAGE decidim_0.0.1-191113
|
|
FROM alpine3.9-ruby2.6_2.6.3-190620
|
|
|
|
# https://github.com/Platoniq/decidim-install/blob/master/decidim-bionic.md
|
|
# https://github.com/Platoniq/decidim-install/blob/master/basic-config.md
|
|
|
|
ENV RAILS_ENV production
|
|
|
|
RUN EOF
|
|
# Install runtime dependencies
|
|
apk --no-cache add curl libpq nodejs pcre procps tzdata
|
|
|
|
# Install build dependencies
|
|
apk --no-cache add --virtual .deps build-base curl-dev icu-dev libxml2-dev libxslt-dev linux-headers pcre-dev postgresql-dev zlib-dev
|
|
|
|
# Install passenger
|
|
gem install passenger --no-document
|
|
|
|
# Create OS user
|
|
addgroup -S -g 8080 decidim
|
|
adduser -S -u 8080 -h /srv/decidim-app -s /sbin/nologin -G decidim -g decidim decidim
|
|
|
|
# Compile nginx
|
|
# taken from passenger-install-nginx-module
|
|
cd /tmp
|
|
wget https://nginx.org/download/nginx-1.17.3.tar.gz
|
|
tar xf nginx-1.17.3.tar.gz
|
|
cd nginx-1.17.3
|
|
./configure \
|
|
--prefix=/var/lib/nginx \
|
|
--sbin-path=/usr/sbin/nginx \
|
|
--conf-path=/etc/nginx/nginx.conf \
|
|
--pid-path=/run/nginx.pid \
|
|
--lock-path=/run/nginx.lock \
|
|
--user=decidim \
|
|
--group=decidim \
|
|
--with-threads \
|
|
--with-file-aio \
|
|
--with-http_ssl_module \
|
|
--with-http_v2_module \
|
|
--with-http_realip_module \
|
|
--with-http_gzip_static_module \
|
|
--with-http_stub_status_module \
|
|
--with-http_addition_module \
|
|
--with-cc-opt=-Wno-error \
|
|
--add-module=/usr/local/lib/ruby/gems/2.6.0/gems/passenger-6.0.4/src/nginx_module
|
|
make -j $(getconf _NPROCESSORS_ONLN)
|
|
make install
|
|
rm -f /etc/nginx/*.default
|
|
|
|
# Install Decidim
|
|
gem install bundler:1.17.3
|
|
bundle config build.nokogiri --use-system-libraries
|
|
gem install decidim
|
|
cd /srv
|
|
decidim decidim-app
|
|
EOF
|
|
|
|
COPY lxc
|
|
|
|
RUN EOF
|
|
# Install gems required by decidim
|
|
cd /srv/decidim-app
|
|
bundle install
|
|
|
|
# Setup delayed job for mail sending
|
|
bin/rails generate delayed_job:active_record
|
|
|
|
# Precompile static assets
|
|
bin/rails assets:precompile
|
|
|
|
# Change ownership
|
|
chown -R decidim:decidim /srv/decidim-app
|
|
|
|
# Cleanup
|
|
apk --no-cache del .deps
|
|
rm -rf /tmp/*
|
|
rm -rf /root/.bundle /root/.gem
|
|
EOF
|
|
|
|
CMD s6-svscan /etc/services.d
|