Skip to content

Commit

Permalink
Merge pull request #1030 from ihatov08/fix_docker
Browse files Browse the repository at this point in the history
Fix docker build error & add docker-compose.yml
  • Loading branch information
jeremybmerrill committed Jul 9, 2019
2 parents 56439f0 + d5913d3 commit 22e9afb
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Dockerfile
@@ -1,27 +1,27 @@
FROM jruby:9.1-jdk

RUN apt-get update -qq && apt-get install -y build-essential
RUN echo 'gem: --no-rdoc --no-ri' >> /.gemrc

ENV GEM_HOME /usr/local/bundle
ENV PATH $GEM_HOME/bin:$PATH
RUN gem install bundler \
RUN gem install bundler -v '< 2' \
&& bundle config --global path "$GEM_HOME" \
&& bundle config --global bin "$GEM_HOME/bin"

# don't create ".bundle" in all our apps
ENV BUNDLE_APP_CONFIG $GEM_HOME

RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
WORKDIR /app

# these didn't work as ONBUILD, strangely. Idk why. -JBM
ADD Gemfile /usr/src/app/
ADD Gemfile.lock /usr/src/app/
ADD Jarfile /usr/src/app/
ADD Jarfile.lock /usr/src/app/
COPY Gemfile ./
COPY Gemfile.lock ./
COPY Jarfile ./
COPY Jarfile.lock ./
RUN bundle install --system
RUN jruby -S jbundle install
ADD . /usr/src/app
COPY . .

EXPOSE 9292
CMD ["jruby", "-G", "-r", "jbundler", "-S", "rackup", "-o", "0.0.0.0"]
CMD ["jruby", "-G", "-r", "jbundler", "-S", "rackup", "-o", "0.0.0.0", "config.ru"]
14 changes: 14 additions & 0 deletions docker-compose.yml
@@ -0,0 +1,14 @@
version: '3.3'
services:
web: &web
build:
context: .
command: "jruby -G -r jbundler -S rackup -p 9292 -o 0.0.0.0 config.ru"
volumes:
- .:/app
- bundle:/usr/local/bundle
ports:
- 9292:9292

volumes:
bundle:

1 comment on commit 22e9afb

@zrg1993
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

docker-compose up
Starting tabula_web_1 ... done
Attaching to tabula_web_1
web_1 | DATA_DIR = /root/.tabula
web_1 | DOCUMENTS_BASEPATH = /root/.tabula/pdfs
web_1 | ENABLE_DEBUG_METHODS = false
web_1 | NameError: missing class name (`org.apache.pdfbox.pdmodel.PDDocument')
web_1 | method_missing at org/jruby/javasupport/JavaPackage.java:259
web_1 |

at /app/lib/tabula_java_wrapper.rb:1
web_1 | require at org/jruby/RubyKernel.java:956
web_1 | (root) at uri:classloader:/jruby/kernel/kernel.rb:1
web_1 | at uri:classloader:/jruby/kernel/kernel.rb:13
web_1 | require at org/jruby/RubyKernel.java:956
web_1 | (root) at /app/webapp/tabula_web.rb:12
web_1 | block in (root) at uri:classloader:/jruby/kernel/kernel.rb:1
web_1 | instance_eval at org/jruby/RubyBasicObject.java:1691
web_1 | require_relative at uri:classloader:/jruby/kernel/kernel.rb:13
web_1 | at /app/config.ru:14
web_1 | eval at org/jruby/RubyKernel.java:995
web_1 | initialize at /usr/local/bundle/jruby/2.3.0/gems/rack-2.1.4/lib/rack/builder.rb:71
web_1 | new_from_string at /app/config.ru:1
web_1 | new_from_string at /usr/local/bundle/jruby/2.3.0/gems/rack-2.1.4/lib/rack/builder.rb:65
web_1 | load_file at /usr/local/bundle/jruby/2.3.0/gems/rack-2.1.4/lib/rack/builder.rb:59
web_1 | parse_file at /usr/local/bundle/jruby/2.3.0/gems/rack-2.1.4/lib/rack/builder.rb:40
web_1 | build_app_and_options_from_config at /usr/local/bundle/jruby/2.3.0/gems/rack-2.1.4/lib/rack/server.rb:351
web_1 | block in app at /usr/local/bundle/jruby/2.3.0/gems/rack-2.1.4/lib/rack/server.rb:251
web_1 | wrapped_app at /usr/local/bundle/jruby/2.3.0/gems/rack-2.1.4/lib/rack/server.rb:424
web_1 | start at /usr/local/bundle/jruby/2.3.0/gems/rack-2.1.4/lib/rack/server.rb:314
web_1 | handle_profiling at /usr/local/bundle/jruby/2.3.0/gems/rack-2.1.4/lib/rack/server.rb:381
web_1 | at /usr/local/bundle/jruby/2.3.0/gems/rack-2.1.4/lib/rack/server.rb:313
web_1 | load at org/jruby/RubyKernel.java:974
web_1 | at /usr/local/bundle/bin/rackup:29
tabula_web_1 exited with code 1

Please sign in to comment.