Files
osem/Dockerfile.production
Henne Vogelsang 93662dc489 Adapt Dockerfile.productiono to openSUSE Leap 15.6
- No need to manually install bundler anymore
- bundle to vendor/bundle
- build nokogiri against system libraries
- expose the port foreman is using
- serve static files
2025-09-04 18:09:50 +02:00

31 lines
790 B
Docker

FROM registry.opensuse.org/opensuse/infrastructure/dale/containers/osem/base:latest
EXPOSE 5000
ENV RAILS_ENV=production
ENV RAILS_SERVE_STATIC_FILES=true
# Add our files
COPY --chown=1000:1000 . /osem/
# Install foreman
RUN gem install foreman
USER osem
WORKDIR /osem/
RUN rm -rf /osem/public/system/sponsors; mkdir -p /osem/public/system/sponsors; \
rm -rf /osem/public/assets; mkdir -p /osem/public/assets; \
rm -rf /osem/log; mkdir -p /osem/public/assets
# Install our bundle
RUN bundle config set --local without 'test development'; \
bundle config set --local path 'vendor/bundle'; \
bundle config build.nokogiri --use-system-libraries; \
bundle install --jobs=4 --retry=3
# Generate assets
RUN bundle exec rake assets:precompile
CMD ["foreman", "start"]