Coder Social home page Coder Social logo

Running with Docker about smui HOT 2 CLOSED

querqy avatar querqy commented on August 16, 2024
Running with Docker

from smui.

Comments (2)

schnoddelbotz avatar schnoddelbotz commented on August 16, 2024

Hope this helps ... this is how we build our own image that runs on k8s.

  1. Do not use "vanilla" image but build your custom image based on Paul's. Adjust your docker-compose -- replace your image: pbartusch/smui section with:
build:
      context: .
      dockerfile: ./path/to/your/Dockerfile
  1. Put something like this into your ./path/to/your/Dockerfile -- we use SQLite, YMMV:
FROM pbartusch/smui

# add dependencies for our custom-smui2solr-script.sh
RUN apk add git curl bash sqlite openssh-client

# /store is persistent storage directory on K8s
RUN mkdir -p /store

# Below env vars are overridden in production ...
# Defaults set below are used for local / docker-compose access.
ENV SMUI_PLAY_APPLICATION_SECRET=fooBarBaz
ENV SMUI_BASIC_AUTH_USER=joe
ENV SMUI_BASIC_AUTH_PASS=1234

# Kept in here for simplicity
ENV SMUI_AUTH_ACTION=controllers.auth.BasicAuthAuthenticatedAction
ENV SMUI_DB_URL=jdbc:sqlite:/store/smui.db
ENV SMUI_DB_JDBC_DRIVER=org.sqlite.JDBC
ENV SMUI_TOGGLE_DEPL_AUTO_DECORATE=true
ENV SMUI_TOGGLE_DEPL_PRELIVE=true
ENV SMUI_TOGGLE_DEPL_CUSTOM_SCRIPT=true
ENV SMUI_TOGGLE_DEPL_CUSTOM_SCRIPT_PATH=/smui/custom-smui2solr-script.sh
ENV SMUI_2SOLR_DST_CP_FILE_TO=/tmp/rules.txt
ENV SMUI_2SOLR_SRC_TMP_FILE=/tmp/rules.txt.tmp

# Consumed by our custom start.sh:
ENV SMUI_HTTP_PORT=9000

ADD ./path/to/local/custom-smui2solr-script.sh /smui/custom-smui2solr-script.sh
ADD ./path/to/local//start.sh /smui/start.sh

# override default startup command
CMD /smui/start.sh

In essence, let the SMUI_TOGGLE_DEPL_CUSTOM_SCRIPT_PATH env var point to your custom smui2solr.sh script and copy it to the image during build using ADD.

  1. Create your custom start.sh. We initialize our SQLite DB with a SQL dump from git ... again, YMMV. In doubt, just let it contain:
#!/bin/sh
exec java -Dhttp.port="${SMUI_HTTP_PORT}" -jar "/smui/search-management-ui-assembly-${SMUI_VERSION}.jar"

This just ensures SMUI runs on port given via ENV in Dockerfile or via env vars in production. Adjust SMUI_VERSION as needed.

I agree that it would be helpful to have a example docker-compose in the repo.

from smui.

pbartusch avatar pbartusch commented on August 16, 2024

I added a description to start SMUI with a simple docker run. The YAML approach is much appreciated. I will consider adding an example YAML file (containing the complete config options) in the future.

from smui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.