You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by mi...@apache.org on 2017/04/10 20:50:03 UTC
[2/3] incubator-trafficcontrol git commit: added infrastructure to
support the UI in a true Docker container
added infrastructure to support the UI in a true Docker container
Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/d6780dcd
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/d6780dcd
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/d6780dcd
Branch: refs/heads/master
Commit: d6780dcdf796d9cdf8ef830eb3953a0466a66fb7
Parents: cc2dacf
Author: Dewayne Richardson <de...@apache.org>
Authored: Mon Apr 10 14:37:49 2017 -0600
Committer: Jeremy Mitchell <mi...@gmail.com>
Committed: Mon Apr 10 14:50:02 2017 -0600
----------------------------------------------------------------------
traffic_ops/experimental/ui/Dockerfile | 13 +++++++++
traffic_ops/experimental/ui/docker-compose.yml | 30 +++++++++++++++++++++
traffic_ops/experimental/ui/toui.sh | 13 +++++++++
3 files changed, 56 insertions(+)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/d6780dcd/traffic_ops/experimental/ui/Dockerfile
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/Dockerfile b/traffic_ops/experimental/ui/Dockerfile
new file mode 100644
index 0000000..bd17931
--- /dev/null
+++ b/traffic_ops/experimental/ui/Dockerfile
@@ -0,0 +1,13 @@
+FROM node:4-onbuild
+#FROM buildpack-deps:jessie
+
+RUN apt-get update -y && apt-get install libffi-dev ruby-dev rubygems vim -y
+
+# replace this with your application's default port
+RUN gem update --system && gem install --no-rdoc --no-ri compass && gem install --no-rdoc --no-ri sass -v 3.4.22
+RUN npm install -g bower grunt-cli
+RUN echo '{ "allow_root": true }' > /root/.bowerrc
+RUN cd /usr/src/app && /usr/local/bin/bower install
+RUN cd /usr/src/app && /usr/local/bin/grunt dist
+
+EXPOSE 8888
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/d6780dcd/traffic_ops/experimental/ui/docker-compose.yml
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/docker-compose.yml b/traffic_ops/experimental/ui/docker-compose.yml
new file mode 100644
index 0000000..a13c07d
--- /dev/null
+++ b/traffic_ops/experimental/ui/docker-compose.yml
@@ -0,0 +1,30 @@
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+version: '2'
+
+services:
+ ui:
+ build:
+ context: .
+ dockerfile: Dockerfile
+ ports:
+ - 80:8080
+ volumes:
+ - /opt/traffic_ops_ui/conf:/opt/traffic_ops_ui/conf
+ networks:
+ - default
+
+networks:
+ default:
+ driver: bridge
http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/d6780dcd/traffic_ops/experimental/ui/toui.sh
----------------------------------------------------------------------
diff --git a/traffic_ops/experimental/ui/toui.sh b/traffic_ops/experimental/ui/toui.sh
new file mode 100755
index 0000000..136a51b
--- /dev/null
+++ b/traffic_ops/experimental/ui/toui.sh
@@ -0,0 +1,13 @@
+#!/usr/bin/env bash
+
+# Temporary helper wrapper script
+ACTION=$1
+
+if [[ "$ACTION" == "run" ]];then
+ docker-compose -p trafficops up -d
+elif [[ "$ACTION" == "stop" ]];then
+ docker-compose -p trafficops down -v
+else
+ echo "Invalid action: only 'run' or 'stop' available."
+fi
+