automated build for docker hub
Java EE 8
- 5.0 (full profile based on
openjdk:8u151-jdk-alpine
image + JCE installed) - 5.0-web (web profile based on
openjdk:8u151-jdk-alpine
image + JCE installed)
Exposed ports:
- 8080 - deployed web apps
- 4848 - management console
- 5005 - remote debug
assuming your application my-app
has implemented /api/health
endpoint:
FROM daggerok/glassfish:5.0
HEALTHCHECK --timeout=2s --retries=22 \
CMD wget -q --spider http://127.0.0.1:8080/my-app/api/health \
|| exit 1
ADD ./build/libs/*.war ${GLASSFISH_HOME}/glassfish/domains/domain1/autodeploy/my-app.war
FROM daggerok/glassfish:5.0-web
# Remote debug:
ENV JAVA_OPTS="$JAVA_OPTS -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 "
EXPOSE 5005
# Multi-builds deployment:
COPY ./build/libs/*.war ./target/*.war ${GLASSFISH_HOME}/glassfish/domains/domain1/autodeploy/
docker run --rm --name glassfish -d -p 4848:4848 -e GLASSFISH_ADMIN_PASSWORD=Admin.123 daggerok/glassfish
FROM daggerok/glassfish:5.0-web-alpine
ENV GLASSFISH_ADMIN_PASSWORD="Admin.123"