diff --git a/docker-compose.yml b/docker-compose.yml index e5e3e74..31f1e4e 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,19 +10,14 @@ services: MYSQL_PASSWORD: openboxes volumes: - ./openboxes-mysql.cnf:/etc/mysql/conf.d/openboxes-mysql.cnf + - ./db/mysql:/var/lib/mysql ports: - "3306:3306" grails: build: ./grails-java7 - command: sh /root/openboxes-run.sh platform: linux/amd64 ports: - "8080:8080" - volumes: - - ./openboxes-config.properties:/root/.grails/openboxes-config.properties - - ./openboxes-setenv.sh:/usr/share/tomcat7/bin/setenv.sh - - ./openboxes-run.sh:/root/openboxes-run.sh - - ../openboxes:/app depends_on: - db diff --git a/grails-java7/Dockerfile b/grails-java7/Dockerfile index 23cd50e..691971b 100644 --- a/grails-java7/Dockerfile +++ b/grails-java7/Dockerfile @@ -1,57 +1,36 @@ -FROM azul/zulu-openjdk:7u352-7.56.0.11 +FROM tomcat:7-jre7-alpine -LABEL maintainer="Michael Seaton mseaton@pih.org" +ARG OPENBOXES_VERSION="v0.8.23-hotfix1" +ARG DB_HOST=db +ARG DB_USER=openboxes +ARG DB_PASS=openboxes +ARG DB_NAME=openboxes -# Environment variables +ARG APP_URL=http://localhost:8080 -ENV SDKMAN_DIR /root/.sdkman -ENV GRAILS_VERSION 1.3.9 -ENV NODE_VERSION=14.21.3 +RUN apk add --no-cache curl +RUN curl -Lv https://github.com/openboxes/openboxes/releases/download/${OPENBOXES_VERSION}/openboxes.war -o /usr/local/tomcat/webapps/openboxes.war -# Install Base Packages required -RUN apt-get update && apt-get install -y curl zip python2 g++ make gcc build-essential git +COPY < $SDKMAN_DIR/etc/config \ - && echo "sdkman_auto_selfupdate=false" >> $SDKMAN_DIR/etc/config \ - && echo "sdkman_curl_connect_timeout=20" >> $SDKMAN_DIR/etc/config \ - && echo "sdkman_curl_max_time=0" >> $SDKMAN_DIR/etc/config \ - && echo "sdkman_insecure_ssl=false" >> $SDKMAN_DIR/etc/config +# in beta +# openboxes.scannerDetection.enabled = true -WORKDIR $SDKMAN_DIR -RUN [[ -s "$SDKMAN_DIR/bin/sdkman-init.sh" ]] && source "$SDKMAN_DIR/bin/sdkman-init.sh" && exec "$@" +# Default server URL +grails.serverURL=${APP_URL} +EOF -RUN source /root/.bashrc - -# install and set grails version -RUN bash -c "source $SDKMAN_DIR/bin/sdkman-init.sh && sdk install grails $GRAILS_VERSION" -RUN bash -c "source $SDKMAN_DIR/bin/sdkman-init.sh && sdk default grails $GRAILS_VERSION" - -# set envs -ENV JAVA_HOME /usr/lib/jvm/zulu7-ca-amd64 -ENV GRAILS_HOME /root/.sdkman/candidates/grails/current -ENV PATH $GRAILS_HOME/bin:$PATH -# Memory settings were required or else things would fail with OOM errors or stall forever -ENV GRAILS_OPTS -XX:MaxPermSize=8192m -Xmx8192M -XX:-UseSplitVerifier -Xverify:none - -# Set the directory that an existing Grails app should be mounted into with a volume -RUN mkdir /app -WORKDIR /app - -EXPOSE 8080 - -CMD ["grails"] \ No newline at end of file