Skip to content
This repository was archived by the owner on Jan 17, 2023. It is now read-only.

Support deploying app to custom context #105

Merged
merged 2 commits into from
Oct 24, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,7 @@ VOLUME ["/var/lib/h2/", "/tomcat7"]

ADD http://atc.gd/docker-registry-ui.war /tomcat7/webapps/ROOT.war

CMD sed -i '1iexport CATALINA_OPTS=" -Djava.security.egd=file:/dev/./urandom "' bin/catalina.sh && bin/catalina.sh run
ADD startup.sh /tomcat7/startup.sh

CMD /tomcat7/startup.sh

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ This project is containerized. You can run with docker right now by simply runni

and browsing to localhost:8080/.

## Application context

Sometimes you may want to run the app in custom context, say `http://server:8080/webui`. To do so, supply the optional variable `APP_CONTEXT`.

docker run -p 8080:8080 -e APP_CONTEXT=/webui atcol/docker-registry-ui

## Statelessness

The app' requires registry configuration which can be supplied once the app's running, or through container environment
Expand Down
6 changes: 6 additions & 0 deletions startup.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
if [ -n "$APP_CONTEXT" ]; then
mv /tomcat7/webapps/ROOT.war /tomcat7/webapps/${APP_CONTEXT}.war
fi
sed -i '1iexport CATALINA_OPTS=" -Djava.security.egd=file:/dev/./urandom "' bin/catalina.sh
bin/catalina.sh run