Skip to content

Commit

Permalink
fix dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
lharzenetter committed Jul 2, 2019
1 parent aaf980e commit 8806bde
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 15 deletions.
17 changes: 8 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ RUN mvn package -DskipTests
FROM tomcat:8.5.31
LABEL maintainer = "Oliver Kopp <[email protected]>, Michael Wurster <[email protected]>, Lukas Harzenetter <[email protected]>"

ARG WINERY_REPOSITORY_PATH=/var/opentosca/repository
ARG DOCKERIZE_VERSION=v0.3.0

ENV WINERY_REPOSITORY_URL ""
Expand All @@ -28,7 +27,9 @@ ENV WORKFLOWMODELER_HOSTNAME localhost
ENV WORKFLOWMODELER_PORT 8080
ENV TOPOLOGYMODELER_HOSTNAME localhost
ENV TOPOLOGYMODELER_PORT 8080
ENV WINERY_REPOSITORY_PATH $WINERY_REPOSITORY_PATH
ENV WINERY_REPOSITORY_PATH "/var/opentosca/repository"
ENV WINERY_HOSTNAME localhost
ENV WINERY_PORT 8080

RUN rm /dev/random && ln -s /dev/urandom /dev/random \
&& curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash \
Expand All @@ -39,26 +40,24 @@ RUN rm /dev/random && ln -s /dev/urandom /dev/random \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf ${CATALINA_HOME}/webapps/* \
&& sed -ie "s/securerandom.source=file:\/dev\/random/securerandom.source=file:\/dev\/.\/urandom/g" /usr/lib/jvm/java-8-openjdk-amd64/jre/lib/security/java.security \
&& mkdir -p $WINERY_REPOSITORY_PATH \
&& cd $WINERY_REPOSITORY_PATH \
&& git init \
&& git config core.fscache true \
&& git lfs install \
&& wget https://github.com/jwilder/dockerize/releases/download/$DOCKERIZE_VERSION/dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& tar -C /usr/local/bin -xzvf dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz \
&& rm dockerize-linux-amd64-$DOCKERIZE_VERSION.tar.gz

COPY --from=builder /tmp/winery/org.eclipse.winery.repository.rest/target/winery.war ${CATALINA_HOME}/webapps/winery.war
COPY --from=builder /tmp/winery/org.eclipse.winery.frontends/target/tosca-management.war ${CATALINA_HOME}/webapps/ROOT.war
COPY --from=builder /tmp/winery/org.eclipse.winery.frontends/target/topologymodeler.war ${CATALINA_HOME}/webapps/winery-topologymodeler-ui.war
COPY --from=builder /tmp/winery/org.eclipse.winery.frontends/target/topologymodeler.war ${CATALINA_HOME}/webapps/winery-topologymodeler.war
COPY --from=builder /tmp/winery/org.eclipse.winery.frontends/target/workflowmodeler.war ${CATALINA_HOME}/webapps/winery-workflowmodeler.war

ADD docker/winery.yml.tpl /root/.winery/winery.yml.tpl

EXPOSE 8080

CMD dockerize -template /root/.winery/winery.yml.tpl:/root/.winery/winery.yml \
&& if [ ! "x${WINERY_REPOSITORY_URL}" = "x" ]; then rm -rf ${WINERY_REPOSITORY_PATH} && git clone ${WINERY_REPOSITORY_URL} ${WINERY_REPOSITORY_PATH}; fi \
&& if [ ! "x${WINERY_REPOSITORY_URL}" = "x" ]; then git clone ${WINERY_REPOSITORY_URL} ${WINERY_REPOSITORY_PATH}; else git init $WINERY_REPOSITORY_PATH; fi \
&& cd ${WINERY_REPOSITORY_PATH} \
&& git config --global core.fscache true \
&& git lfs install \
&& echo 'export CATALINA_OPTS="-Djava.security.egd=file:/dev/./urandom -Xms512m -Xmx${WINERY_HEAP_MAX} -XX:MaxPermSize=256m"' > ${CATALINA_HOME}/bin/setenv.sh \
&& if [ ! "x${WINERY_JMX_ENABLED}" = "x" ]; then echo 'export CATALINA_OPTS="${CATALINA_OPTS} -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.local.only=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.port=9010 -Dcom.sun.management.jmxremote.rmi.port=9010 -Djava.rmi.server.hostname=0.0.0.0 -Dcom.sun.management.jmxremote.ssl=false"' >> ${CATALINA_HOME}/bin/setenv.sh; fi \
&& chmod a+x ${CATALINA_HOME}/bin/setenv.sh \
Expand Down
10 changes: 5 additions & 5 deletions docker/winery.yml.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ ui:
splitting: true
testRefinement: true
endpoints:
container: http\://{{ .Env.CONTAINER_HOSTNAME }}\:{{ .Env.CONTAINER_PORT }}
workflowmodeler: http\://{{ .Env.WORKFLOWMODELER_HOSTNAME }}\:{{ .Env.WORKFLOWMODELER_PORT }}/winery-workflowmodeler
topologymodeler: http\://{{ .Env.TOPOLOGYMODELER_HOSTNAME }}\:{{ .Env.TOPOLOGYMODELER_PORT }}/winery-topologymodeler
repositoryApiUrl: http://localhost:8080/winery
repositoryUiUrl: http://localhost:8080/#
container: http://{{ .Env.CONTAINER_HOSTNAME }}:{{ .Env.CONTAINER_PORT }}
workflowmodeler: http://{{ .Env.WORKFLOWMODELER_HOSTNAME }}:{{ .Env.WORKFLOWMODELER_PORT }}/winery-workflowmodeler
topologymodeler: http://{{ .Env.TOPOLOGYMODELER_HOSTNAME }}:{{ .Env.TOPOLOGYMODELER_PORT }}/winery-topologymodeler
repositoryApiUrl: http://{{ .Env.WINERY_HOSTNAME }}:{{ .Env.WINERY_PORT }}/winery
repositoryUiUrl: http://{{ .Env.WINERY_HOSTNAME }}:{{ .Env.WINERY_PORT }}/#
repository:
provider: file
repositoryRoot: {{ .Env.WINERY_REPOSITORY_PATH }}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
(ioBtnClicked)="onEditPlanIOParameters($event);">
<div class="button-group pull-right">
<button type="button" class="btn btn-primary"
(click)="onGeneratePlans($event)">
(click)="onGeneratePlans()">
Generate Plans
</button>
</div>
Expand Down

0 comments on commit 8806bde

Please sign in to comment.