File Dockerfile of Package geminabox-docker

#!BuildTag: geminabox
FROM opensuse:42.3

RUN mkdir -p /usr/src/app

RUN zypper -n install --no-recommends --replacefiles ruby2.4-rubygem-bundler wget curl vim

WORKDIR /usr/src/app

ADD vendor.obscpio /usr/src/app
ADD Gemfile /usr/src/app
ADD Gemfile.lock /usr/src/app
ADD /usr/src/app

RUN cpio -i --make-directories --format=newc < vendor.obscpio
RUN mkdir -p /usr/src/app/vendor/cache
RUN cp /usr/src/app/vendor/bundle/vendor/cache/*gem /usr/src/app/vendor/cache
RUN rm -rf /usr/src/app/vendor/bundle

RUN bundle config --global frozen 1
RUN bundle install --local --path vendor/bundle

USER wwwrun

ENTRYPOINT ["bundle", "exec", "rackup", "--host", ""]

# This is a workaround as the backend removes custom repositories and scripts and needs to be root
# We can remove it as soon as the issue is fixed in the backend
USER root