Skip to content

Instantly share code, notes, and snippets.

@BHSPitMonkey
Last active August 29, 2015 13:57
Show Gist options
  • Save BHSPitMonkey/9747709 to your computer and use it in GitHub Desktop.
Save BHSPitMonkey/9747709 to your computer and use it in GitHub Desktop.
A Dockerfile for the DAITSS Format Description Service (https://github.com/daitss/describe)
# This is an example of the DAITSS configuration file restricted to
# the data necessary to run the describe service.
#
# You must set up your web server to set the environment variable
# DAITSS_CONFIG to point to a configuration file along these lines,
# though typically it will have sections for many services in addition
# to this one.
#
# Please don't use tabs in this file.
defaults:
# We normally name sections after the virtual hostname used by an
# applcation (this is so one physical host can run multiple services
# of the same kind). An application's configuration code typically
# checks the VIRTUAL_HOSTNAME environment variable to determine the
# appropriate section to load. Typically VIRTUAL_HOSTNAME is set in
# the same place that the DAITTS_CONFIG environment is set.
localhost:
log_syslog_facility: LOG_LOCAL0
log_filename: describe.log
max_pdf_bitstreams: 1000
max_upload_file_size: 4096MB
pdfa_validator: /opt/pdfapilot/pdfaPilot -a $INPUT_FILE$ --level=$LEVEL$ --report=XML,ALWAYS,PATH=$REPORT_FILE$
jvm_options:
- -Dhttp.proxyHost=localhost
- -Dhttp.proxyPort=3128
# describe:log_syslog_facility
# -------------------------------
# If set, direct log information to this syslog facility (see
# /etc/syslog.conf). If neither log_filename nor log_syslog_facility
# are set, log to STDERR.
#
# describe:log_filename
# -------------------------------
# If set, direct log information to this file. If neither log_filename
# nor log_syslog_facility are set, log to STDERR.
##
# describe:max_pdf_bitstreams (optional)
# --------------------------
# Sets the maximum number of bitstreams per file describe will attempt to parse
##
# describe:max_upload_file_size (optional)
# --------------------------
# display the max file size for file upload.
# DAITSS Description Service
# for Docker 0.7 or newer
#
# This Dockerfile builds an image that runs the DAITSS Description Service
# (http://github.com/daitss/describe) at commit 5035ef1a9a (a new version
# using Ruby 1.9.3).
#
# How to use (assuming Docker is installed):
#
# # This builds the Docker image. Wait for the command to finish.
# sudo docker build -t describe .
#
# # This creates a container based on the image and runs it in daemon mode,
# # binding port 3000 on the host machine to port 3000 in the container.
# # The container name will be 'descrip'. Change as desired.
# sudo docker run -d -p 3000:3000 -name descrip describe
#
# If at any point the container becomes stopped, you can start it again using:
#
# sudo docker start descrip
#
# To stop the container, use:
#
# sudo docker stop descrip
#
# VERSION 0.1
FROM dockerfile/java
ENV JAVA_HOME /usr/lib/jvm/java-7-oracle
# Install prerequisites
RUN echo "debconf debconf/frontend select Teletype" | debconf-set-selections
RUN apt-get update
RUN apt-get install -y curl git libxml2-dev libxslt1-dev
# Get RVM and Ruby
RUN \curl -sSL https://get.rvm.io | bash -s stable
RUN /bin/bash -l -c "rvm install ruby-1.9.3-p392"
# Get description service
RUN curl -L https://github.com/daitss/describe/archive/5035ef1a9a4dd0aea1eedc3f4ad5e8a619974b95.tar.gz | tar zx
RUN mv describe-5035ef1a9a4dd0aea1eedc3f4ad5e8a619974b95 describe
RUN /bin/bash -l -c "cd describe && rvm use 1.9.3-p392 && bundle install"
# Configure description service
ADD daitss-config.yml /etc/
# Running the description service
CMD /bin/bash -l -c "cd describe && DAITSS_CONFIG=/etc/daitss-config.yml VIRTUAL_HOSTNAME=localhost bundle exec thin start"
# Expose port 3000
EXPOSE 3000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment