45 lines
1.4 KiB
Docker
45 lines
1.4 KiB
Docker
# Run Foreman v1.6 stable in a container
|
|
|
|
# Foreman v1.6 http://www.theforeman.org/manuals/1.6/#3.4InstallFromSource
|
|
|
|
FROM alpine:3.3
|
|
MAINTAINER Andrey Arapov <andrey.arapov@nixaid.com>
|
|
|
|
ENV USER foreman
|
|
ENV UID 30000
|
|
ENV HOME /home/$USER
|
|
ENV WORKDIR /src
|
|
# ENV RAILS_ENV development
|
|
ENV RAILS_ENV production
|
|
|
|
COPY foreman-patch.diff /tmp/foreman-patch.diff
|
|
|
|
RUN apk update \
|
|
&& apk add git gcc g++ make \
|
|
ruby-dev ruby-bundler ruby-io-console libxml2-dev libxslt-dev \
|
|
libffi-dev mariadb-dev postgresql-dev libvirt-dev sqlite-dev \
|
|
ruby-bigdecimal ruby-irb nodejs \
|
|
&& adduser -D -h $HOME -u $UID $USER \
|
|
&& mkdir $WORKDIR \
|
|
&& chown $USER:$USER $WORKDIR
|
|
|
|
RUN su $USER -c "cd $WORKDIR \
|
|
&& git clone https://github.com/theforeman/foreman.git foreman -b 1.6-stable \
|
|
&& cd foreman/ \
|
|
&& cp -p config/settings.yaml.example config/settings.yaml \
|
|
&& cp -p config/database.yml.example config/database.yml \
|
|
&& bundle config build.nokogiri --use-system-libraries \
|
|
&& patch -p1 < /tmp/foreman-patch.diff \
|
|
&& bundle install --standalone --path vendor/bundle \
|
|
&& bundle install --deployment --path vendor/bundle \
|
|
&& bundle exec rake db:migrate \
|
|
&& bundle exec rake db:seed assets:precompile locale:pack"
|
|
|
|
# && bundle config --global DISABLE_SHARED_GEMS "1" \
|
|
|
|
VOLUME [ "/src/foreman" ]
|
|
|
|
WORKDIR $HOME
|
|
USER $USER
|
|
CMD [ "/bin/sh" ]
|