From 25aafbe7e6c51cdda2110c255be8581689151c4d Mon Sep 17 00:00:00 2001 From: Gavin Date: Thu, 11 Apr 2024 14:51:47 -0700 Subject: [PATCH] Fix docker build --- Dockerfile | 14 ++++++++++---- docker-compose.yml | 46 ++++++++++------------------------------------ 2 files changed, 20 insertions(+), 40 deletions(-) diff --git a/Dockerfile b/Dockerfile index 78909750..103b3461 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,11 @@ +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 @@ -5,10 +13,8 @@ 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 diff --git a/docker-compose.yml b/docker-compose.yml index beb4b9b3..2aaed1b7 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -5,15 +5,18 @@ 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 @@ -21,9 +24,7 @@ services: command: - "-multiline" - "-wait" - - "tcp://ci-mongo:27017" - - "-wait" - - "tcp://mongoinit:8080" + - "tcp://mongo:27017" - "-timeout" - "120s" - "-template" @@ -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"