Skip to content

Commit

Permalink
docker: make the start command configurable via START_TOMCAT_OPTS
Browse files Browse the repository at this point in the history
Signed-off-by: Pierre-Alexandre Meyer <pierre@mouraf.org>
  • Loading branch information
pierre committed Jul 25, 2018
1 parent dd341f7 commit 40f910b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions ansible/roles/tomcat/tasks/restart.yml
Expand Up @@ -37,6 +37,8 @@
- work/
when:
- catalina_home is defined
tags:
- tomcat_cleanup

- name: start Tomcat
become: true
Expand Down
7 changes: 5 additions & 2 deletions docker/templates/base/latest/Dockerfile
Expand Up @@ -109,13 +109,16 @@ RUN ansible-playbook $ANSIBLE_OPTS \
-e gnu_arch="$(dpkg-architecture --query DEB_BUILD_GNU_TYPE)" \
$KILLBILL_CLOUD_ANSIBLE_ROLES/tomcat.yml

ENV START_TOMCAT_CMD ansible-playbook $ANSIBLE_OPTS \
ENV START_TOMCAT_CMD ansible-playbook $ANSIBLE_OPTS \
-e tomcat_owner=$TOMCAT_OWNER \
-e tomcat_group=$TOMCAT_GROUP \
-e tomcat_home=$TOMCAT_HOME \
-e catalina_home=$CATALINA_HOME \
-e catalina_base=$CATALINA_BASE \
$KILLBILL_CLOUD_ANSIBLE_ROLES/tomcat_restart.yml

ENV START_TOMCAT_OPTS ''

# Start Tomcat
EXPOSE 8080
CMD ["bash", "-c", "$START_TOMCAT_CMD && tail -F $CATALINA_BASE/logs/catalina.out"]
CMD ["bash", "-c", "$START_TOMCAT_CMD $START_TOMCAT_OPTS && tail -F $CATALINA_BASE/logs/catalina.out"]
2 changes: 1 addition & 1 deletion docker/templates/killbill/latest/Dockerfile
Expand Up @@ -26,4 +26,4 @@ ENV KPM_INSTALL_CMD ansible-playbook $ANSIBLE_OPTS \
-e catalina_base=$CATALINA_BASE \
$KILLBILL_CLOUD_ANSIBLE_ROLES/killbill.yml
# Run kpm install
CMD ["bash", "-c", "$KPM_INSTALL_CMD && $START_TOMCAT_CMD && touch $CATALINA_BASE/logs/killbill.out && tail -F $CATALINA_BASE/logs/killbill.out"]
CMD ["bash", "-c", "$KPM_INSTALL_CMD && $START_TOMCAT_CMD $START_TOMCAT_OPTS && touch $CATALINA_BASE/logs/killbill.out && tail -F $CATALINA_BASE/logs/killbill.out"]

0 comments on commit 40f910b

Please sign in to comment.