Skip to content

Commit

Permalink
Fix docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
MrCreosote committed Apr 11, 2024
1 parent faffb27 commit 25aafbe
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 40 deletions.
14 changes: 10 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
FROM kbase/sdkbase2 as build

COPY . /tmp/groups
RUN cd /tmp \
&& git clone https://github.com/kbase/jars \
&& cd groups \
&& ant buildwar

FROM kbase/kb_jre:latest

# These ARGs values are passed in via the docker build command
ARG BUILD_DATE
ARG VCS_REF
ARG BRANCH=develop

RUN apt-get -y update && apt-get -y install ant git openjdk-8-jdk

COPY deployment/ /kb/deployment/
COPY jettybase/ /kb/deployment/jettybase/
COPY --from=build /tmp/groups/deployment/ /kb/deployment/
COPY --from=build /tmp/groups/jettybase/ /kb/deployment/jettybase/

# The BUILD_DATE value seem to bust the docker cache when the timestamp changes, move to
# the end
Expand Down
46 changes: 10 additions & 36 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,26 @@ version: "3.1"
# that is started up and polled
services:
kbase_groups:
image: kbase/groups:latest
build: .
ports:
- "8080:8080"
environment:
mongo-host: localhost:27017
mongo-db: dc_groups_test
mongo_host: "mongo:27017"
mongo_db: dc_groups_test
auth_url: https://ci.kbase.us/services/auth
workspace_url: https://ci.kbase.us/services/ws
catalog_url: https://ci.kbase.us/services/catalog
notifier_url: https://ci.kbase.us/services/feeds
workspace_admin_token: faketoken_replace
notifier_token: faketoken_replace
field_validator_configs: |
field-foo-validator=us.kbase.groups.fieldvalidators.SimpleFieldValidatorFactory
field-foo-is-numbered=true
# add more configurations here
command:
- "-multiline"
- "-wait"
- "tcp://ci-mongo:27017"
- "-wait"
- "tcp://mongoinit:8080"
- "tcp://mongo:27017"
- "-timeout"
- "120s"
- "-template"
Expand All @@ -32,37 +33,10 @@ services:
- "-Djetty.home=/usr/local/jetty"
- "-jar"
- "/usr/local/jetty/start.jar"
# If you needed to pass in context for template evaluation you would put something like
# these lines that tell dockerize to hit github for an INI style file for the context
# - "-env"
# - "https://raw.githubusercontent.com/kbase/mini_kb/master/deployment/conf/tauth2-minikb.yml"
# If the -env URL needs authentication you would use an -env-header directive that specified
# either the hard coded string for the header, or a path to a file that contains the header
# string ( used for working with docker secrets files)
# - "-env-header"
# - "AUTHORIZATION:authtokenvalue"
# or for a path to a secrets file:
# - "env-header"
# - "/run/secrets/authheader"
# If your server is using self-signed certs, or otherwise problematic for cert validation
# you can add the following flag:
# - "-validateCert=false"
depends_on: ["ci-mongo", "mongoinit"]
depends_on: ["mongo"]

mongoinit:
image: kbase/db_initialize:latest
entrypoint:
- "/kb/deployment/bin/dockerize.sh"
- "-wait"
- "tcp://ci-mongo:27017"
- "-timeout"
- "120s"
depends_on: [ "ci-mongo" ]

ci-mongo:
image: mongo:2
command:
- "--smallfiles"
mongo:
image: mongo:3.6
ports:
- "27017:27017"

0 comments on commit 25aafbe

Please sign in to comment.