You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@senssoft.apache.org by ar...@apache.org on 2017/07/12 15:11:56 UTC
incubator-senssoft-tap git commit: Modified dockerfiles to do
independent TAP testing
Repository: incubator-senssoft-tap
Updated Branches:
refs/heads/tapdocker [created] 76cb5d97b
Modified dockerfiles to do independent TAP testing
Project: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/commit/76cb5d97
Tree: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/tree/76cb5d97
Diff: http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/diff/76cb5d97
Branch: refs/heads/tapdocker
Commit: 76cb5d97b1141b7f4fd03d6bce2b7b9d5fbdeefa
Parents: 0ccd7ab
Author: Arthi Vezhavendan <ar...@gmail.com>
Authored: Wed Jul 12 11:11:46 2017 -0400
Committer: Arthi Vezhavendan <ar...@gmail.com>
Committed: Wed Jul 12 11:11:46 2017 -0400
----------------------------------------------------------------------
Dockerfile | 34 ++++++++++++++-------
docker-compose.yml | 57 ++++--------------------------------
docker/tap/wait-for-postgres.sh | 27 +++++++++++++++++
wait-for-postgres.sh | 27 +++++++++++++++++
4 files changed, 82 insertions(+), 63 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/76cb5d97/Dockerfile
----------------------------------------------------------------------
diff --git a/Dockerfile b/Dockerfile
index 6b37aab..264d265 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,22 +1,34 @@
FROM python:3.4
+MAINTAINER Michelle Beard <ms...@apache.org>
-echo "curl"
-RUN curl -sL https://deb.nodesource.com/setup | bash -
+# Install system wide dependencies
+RUN apt-get -yqq update && apt-get -yqq install \
+ curl \
+ sudo
-echo "apt-get"
-RUN apt-get -y install nodejs
+# Install NodeJS 4.x
+RUN curl -sL https://deb.nodesource.com/setup_4.x | sudo -E bash -
+RUN sudo -E apt-get -yqq install \
+ nodejs \
+ build-essential
-RUN mkdir -p /usr/src/app
-WORKDIR /usr/src/app
-COPY . /usr/src/app
+# Set the work directory
+RUN mkdir -p /usr/src
+WORKDIR /usr/src
+COPY . /usr/src
-RUN pip install -r requirements.txt
+# Install gulp
+RUN npm install -g bower gulp
-RUN npm install -g gulp
+# Install packages
RUN npm install
-RUN python manage.py runserver 0.0.0.0:8000
-RUN gulp dev
+# Install TAP requirements
+RUN pip install -r requirements.txt
+
+# Startup Application
+RUN gulp build
+# Export port
EXPOSE 8000
http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/76cb5d97/docker-compose.yml
----------------------------------------------------------------------
diff --git a/docker-compose.yml b/docker-compose.yml
index 5ed59c0..19a00cb 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -18,65 +18,18 @@
version: "2"
services:
db:
- container_name: tap-db
+ container_name: tap-db
build: ./docker/db
ports:
- "5432:5432"
tap:
container_name: tap-web
- build: ./docker/tap
- command: bash -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
+ build: .
+ command: bash -c "/usr/src/wait-for-postgres.sh"
+ # command: bash -c "python manage.py migrate && python manage.py runserver 0.0.0.0:8000"
ports:
- "8000:8000"
depends_on:
- db
links:
- - db:db
- distill:
- build:
- context: .
- dockerfile: ./docker/distill/Dockerfile
- container_name: distill
- ports:
- - 8090:8090
- depends_on:
- - elasticsearch
- links:
- - elasticsearch
- # Web server
- #webserver:
- # build: ./docker/webserver
- # container_name: webserver
- # links:
- # - distill
- # ELK Stack
- elasticsearch:
- build: ./docker/es
- container_name: elastic
- ports:
- - 9200:9200
- - 9300:9300
- volumes:
- - ./es/data:/usr/share/elasticsearch/data
- - ./es/logs:/usr/share/elasticsearch/logs
- kibana:
- build: ./docker/kibana
- container_name: kibana
- ports:
- - 5601:5601
- depends_on:
- - elasticsearch
- links:
- - elasticsearch
- logstash:
- build: ./docker/logstash
- container_name: logstash
- ports:
- - 8888:8888
- command: logstash -f /etc/logstash/conf.d/logstash.conf
- volumes:
- - ./userale:/var/log/sennsoft
- depends_on:
- - elasticsearch
- links:
- - elasticsearch
\ No newline at end of file
+ - db:db
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/76cb5d97/docker/tap/wait-for-postgres.sh
----------------------------------------------------------------------
diff --git a/docker/tap/wait-for-postgres.sh b/docker/tap/wait-for-postgres.sh
new file mode 100644
index 0000000..96084c7
--- /dev/null
+++ b/docker/tap/wait-for-postgres.sh
@@ -0,0 +1,27 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+#!/bin/bash
+
+delay=2
+sleep $delay
+n=0
+until [ $n -ge 3 ]
+do
+ python manage.py migrate && python manage.py runserver 0.0.0.0:8000 && break
+ echo "Retrying connection in $delay seconds..."
+ n=$[$n+1]
+ sleep 2
+done
http://git-wip-us.apache.org/repos/asf/incubator-senssoft-tap/blob/76cb5d97/wait-for-postgres.sh
----------------------------------------------------------------------
diff --git a/wait-for-postgres.sh b/wait-for-postgres.sh
new file mode 100644
index 0000000..96084c7
--- /dev/null
+++ b/wait-for-postgres.sh
@@ -0,0 +1,27 @@
+# Licensed to the Apache Software Foundation (ASF) under one or more
+# contributor license agreements. See the NOTICE file distributed with
+# this work for additional information regarding copyright ownership.
+# The ASF licenses this file to You 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.
+
+#!/bin/bash
+
+delay=2
+sleep $delay
+n=0
+until [ $n -ge 3 ]
+do
+ python manage.py migrate && python manage.py runserver 0.0.0.0:8000 && break
+ echo "Retrying connection in $delay seconds..."
+ n=$[$n+1]
+ sleep 2
+done