Sling is an established web application framework, with a multitude of core features and extensions. It has a very productive inner loop, with OSGi bundle deployment, JCR content editing and live configuration updates. The less-told story is how an application should be assembled, configured, deployed, and monitored.
In this talk we will present the main approaches for bootstrapping, deploying, updating, and monitoring Sling-based applications, based on Open Source tools and libraries.
The participants will gain a better understanding of the options available for managing their own Sling-based application and will be able to minimise the effort needed to manage such an application.
16. [Deploy] Container image
FROM docker.io/apache/sling:snapshot AS starter
FROM docker.io/eclipse-temurin:17
ENV EXTRA_JAVA_OPTS="-Dorg.apache.felix.configadmin.plugin.interpolation.secretsdir=/etc/pospai/secrets"
EXPOSE 8080
RUN groupadd --system sling &&
useradd --no-log-init --system --gid sling sling &&
mkdir /opt/sling &&
mkdir /opt/sling/bin &&
mkdir /opt/sling/org.apache.sling.feature.launcher &&
mkdir /opt/sling/launcher &&
mkdir /opt/sling/artifacts &&
mkdir /opt/sling/agents &&
chown -R sling:sling /opt/sling/launcher
VOLUME /opt/sling/launcher
# continued on the next slide
16
17. [Deploy] Container image (2)
# continued from the next slide
COPY --from=starter /opt/sling/bin /opt/sling/bin
COPY target/dependency/org.apache.sling.feature.launcher /opt/sling/org.apache.sling.feature.launcher
COPY target/artifacts/ /opt/sling/artifacts/
# ensure all files are readable by the sling user
# for some reason some jar files are 0600 while most are 0644
RUN find /opt/sling/artifacts -type f -perm 0600 | xargs --no-run-if-empty chmod 0644
USER sling:sling
WORKDIR /opt/sling
ENTRYPOINT [ "/opt/sling/bin/launch.sh" ]
CMD ["oak_tar"]
17