File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -19,12 +19,20 @@ RUN if [ "$TOMCAT_EXTRAS" = false ]; then \
1919 find "${CATALINA_BASE}/webapps/" -delete; \
2020 fi
2121
22+ # Create a non-privileged tomcat user
23+ ARG USER_GID=999
24+ ARG USER_UID=999
25+ RUN addgroup --gid ${USER_GID} tomcat && \
26+ adduser --system -u ${USER_UID} --gid ${USER_GID} --no-create-home tomcat && \
27+ chown -R tomcat:tomcat ${CATALINA_BASE}/ && \
28+ chown tomcat:tomcat /docker-entrypoint.d
29+
2230# Add application from first stage
23- COPY --from=extractwar /tmp/mapstore "${CATALINA_BASE}/webapps/mapstore"
24- COPY georchestra-docker-scripts/ /
31+ COPY --chown=tomcat:tomcat -- from=extractwar /tmp/mapstore "${CATALINA_BASE}/webapps/mapstore"
32+ COPY --chown=tomcat:tomcat georchestra-docker-scripts/ /
2533# SHould be override in 2024.xx when a server.xml on 8080 will be available
26- COPY docker/server.xml "${CATALINA_BASE}/conf/"
27-
34+ COPY --chown=tomcat:tomcat docker/server.xml "${CATALINA_BASE}/conf/"
35+ USER tomcat
2836
2937# Geostore externalization template. Disabled by default
3038# COPY docker/geostore-datasource-ovr.properties "${CATALINA_BASE}/conf/"
@@ -38,4 +46,5 @@ ENV TERM xterm
3846# Necessary to execute tomcat and custom scripts
3947ENTRYPOINT ["/docker-entrypoint.sh" ]
4048CMD ["catalina.sh" , "run" ]
49+
4150EXPOSE 8080
You can’t perform that action at this time.
0 commit comments