Git Product home page Git Product logo

Comments (12)

EugenMayer avatar EugenMayer commented on May 25, 2024

Are you building your own image with the statements above or what are you reffering to?

The configuration at /etc/app/application.properties should be picked up, yes

from docker-image-jodconverter-examples.

wussup avatar wussup commented on May 25, 2024

IMHO configuration is not working. @EugenMayer you could try to add an additional line before entrypoint in Dockerfile to test it:

RUN echo "server.port=8090" > /etc/app/application.properties

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["-Dspring.config.location=/etc/app/application.properties"]

After running you will see, that application runs on default port 8080.

from docker-image-jodconverter-examples.

mexekanez avatar mexekanez commented on May 25, 2024

yes, @wussup you got the point. configs don't seem to be working.

only one way - build custom image and adjust .yaml settings before

from docker-image-jodconverter-examples.

EugenMayer avatar EugenMayer commented on May 25, 2024

Please post you entires Dockerfile you build not just some snippets of whatever there might be.

We might have an issue still, but let me invstigate with the informations

from docker-image-jodconverter-examples.

wussup avatar wussup commented on May 25, 2024

@EugenMayer this is your Dockerfile with my echo to application.properties

#  ---------------------------------- setup our needed libreoffice engaged server with newest glibc
# we cannot use the official image since we then cannot have sid and the glibc fix
#FROM openjdk:11.0-jre-slim-stretch as jodconverter-base
FROM debian:sid as jodconverter-base
# backports would only be needed for stretch
#RUN echo "deb http://ftp2.de.debian.org/debian stretch-backports main contrib non-free" > /etc/apt/sources.list.d/debian-backports.list
RUN apt-get update && apt-get -y install \
        openjdk-11-jre \
        apt-transport-https locales-all libpng16-16 libxinerama1 libgl1-mesa-glx libfontconfig1 libfreetype6 libxrender1 \
        libxcb-shm0 libxcb-render0 adduser cpio findutils \
        # procps needed for us finding the libreoffice process, see https://github.com/sbraconnier/jodconverter/issues/127#issuecomment-463668183
        procps \
    # only for stretch
    #&& apt-get -y install -t stretch-backports libreoffice --no-install-recommends \
    # sid variant
    && apt-get -y install libreoffice --no-install-recommends \
    && rm -rf /var/lib/apt/lists/*
ENV JAR_FILE_NAME=app.war
ENV JAR_FILE_BASEDIR=/opt/app
ENV LOG_BASE_DIR=/var/log

COPY bin/docker-entrypoint.sh /docker-entrypoint.sh

RUN mkdir -p ${JAR_FILE_BASEDIR} /etc/app \
  && touch /etc/app/application.properties \
  && chmod +x /docker-entrypoint.sh

RUN echo "server.port=8090" > /etc/app/application.properties

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["-Dspring.config.location=/etc/app/application.properties"]

#  ----------------------------------  build our jodconvert builder, so source code with build tools
# TODO: java11 compat yet not given for jodconverter https://github.com/sbraconnier/jodconverter/pull/128
FROM openjdk:11-jdk as jodconverter-builder
RUN apt-get update \
  && apt-get -y install git \
  && git clone https://github.com/sbraconnier/jodconverter /tmp/jodconverter \
  && mkdir /dist

#  ---------------------------------- gui builder
FROM jodconverter-builder as jodconverter-gui
WORKDIR /tmp/jodconverter/jodconverter-samples/jodconverter-sample-spring-boot
RUN ../../gradlew build \
  && cp build/libs/*SNAPSHOT.war /dist/jodconverter-gui.war


#  ----------------------------------  rest build
FROM jodconverter-builder as jodconverter-rest
WORKDIR /tmp/jodconverter/jodconverter-samples/jodconverter-sample-rest
RUN ../../gradlew build \
  && cp build/libs/*SNAPSHOT.war /dist/jodconverter-rest.war


#  ----------------------------------  GUI prod image
FROM jodconverter-base as gui
COPY --from=jodconverter-gui /dist/jodconverter-gui.war ${JAR_FILE_BASEDIR}/${JAR_FILE_NAME}

#  ----------------------------------  REST prod image
FROM jodconverter-base as rest
COPY --from=jodconverter-rest /dist/jodconverter-rest.war ${JAR_FILE_BASEDIR}/${JAR_FILE_NAME}

from docker-image-jodconverter-examples.

mexekanez avatar mexekanez commented on May 25, 2024

and even more, simplified test version:

FROM eugenmayer/jodconverter:rest
COPY config/application.properties /etc/app/application.properties

from docker-image-jodconverter-examples.

wussup avatar wussup commented on May 25, 2024

@EugenMayer @mexekanez guys, please check fix.

from docker-image-jodconverter-examples.

mexekanez avatar mexekanez commented on May 25, 2024

@wussup does it working for you?

from docker-image-jodconverter-examples.

wussup avatar wussup commented on May 25, 2024

@mexekanez yes, this example starts on port 8090 as specified in application.properties :

#  ---------------------------------- setup our needed libreoffice engaged server with newest glibc
# we cannot use the official image since we then cannot have sid and the glibc fix
#FROM openjdk:11.0-jre-slim-stretch as jodconverter-base
FROM debian:sid as jodconverter-base
# backports would only be needed for stretch
#RUN echo "deb http://ftp2.de.debian.org/debian stretch-backports main contrib non-free" > /etc/apt/sources.list.d/debian-backports.list
RUN apt-get update && apt-get -y install \
        openjdk-11-jre \
        apt-transport-https locales-all libpng16-16 libxinerama1 libgl1-mesa-glx libfontconfig1 libfreetype6 libxrender1 \
        libxcb-shm0 libxcb-render0 adduser cpio findutils \
        # procps needed for us finding the libreoffice process, see https://github.com/sbraconnier/jodconverter/issues/127#issuecomment-463668183
        procps \
    # only for stretch
    #&& apt-get -y install -t stretch-backports libreoffice --no-install-recommends \
    # sid variant
    && apt-get -y install libreoffice --no-install-recommends \
    && rm -rf /var/lib/apt/lists/*
ENV JAR_FILE_NAME=app.war
ENV JAR_FILE_BASEDIR=/opt/app
ENV LOG_BASE_DIR=/var/log

COPY bin/docker-entrypoint.sh /docker-entrypoint.sh

RUN mkdir -p ${JAR_FILE_BASEDIR} /etc/app \
  && touch /etc/app/application.properties \
  && chmod +x /docker-entrypoint.sh

RUN echo "server.port=8090" > /etc/app/application.properties

ENTRYPOINT ["/docker-entrypoint.sh"]
CMD ["--spring.config.additional-location=/etc/app/"]

#  ----------------------------------  build our jodconvert builder, so source code with build tools
# TODO: java11 compat yet not given for jodconverter https://github.com/sbraconnier/jodconverter/pull/128
FROM openjdk:11-jdk as jodconverter-builder
RUN apt-get update \
  && apt-get -y install git \
  && git clone https://github.com/sbraconnier/jodconverter /tmp/jodconverter \
  && mkdir /dist

#  ---------------------------------- gui builder
FROM jodconverter-builder as jodconverter-gui
WORKDIR /tmp/jodconverter/jodconverter-samples/jodconverter-sample-spring-boot
RUN ../../gradlew build \
  && cp build/libs/*SNAPSHOT.war /dist/jodconverter-gui.war


#  ----------------------------------  rest build
FROM jodconverter-builder as jodconverter-rest
WORKDIR /tmp/jodconverter/jodconverter-samples/jodconverter-sample-rest
RUN ../../gradlew build \
  && cp build/libs/*SNAPSHOT.war /dist/jodconverter-rest.war


#  ----------------------------------  GUI prod image
FROM jodconverter-base as gui
COPY --from=jodconverter-gui /dist/jodconverter-gui.war ${JAR_FILE_BASEDIR}/${JAR_FILE_NAME}

#  ----------------------------------  REST prod image
FROM jodconverter-base as rest
COPY --from=jodconverter-rest /dist/jodconverter-rest.war ${JAR_FILE_BASEDIR}/${JAR_FILE_NAME}
 

from docker-image-jodconverter-examples.

wussup avatar wussup commented on May 25, 2024

Also tested in the test environment of my application, now everything is ok, waiting for your feedback.

from docker-image-jodconverter-examples.

wussup avatar wussup commented on May 25, 2024

Here is explanation https://stackoverflow.com/a/47210661/4141492

from docker-image-jodconverter-examples.

EugenMayer avatar EugenMayer commented on May 25, 2024

Sorry, took me a while. Thank you for digging that one out and correcting it!

from docker-image-jodconverter-examples.

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.