cleanup old docker cruft

This commit is contained in:
Adam Brown 2016-11-03 19:16:54 -04:00
parent dbc4bac6a2
commit 5a55902b5b
9 changed files with 3 additions and 183 deletions

0
docker/.gitignore vendored
View File

View File

@ -1,51 +0,0 @@
# start with docker's base ubuntu image
FROM ubuntu:14.04
MAINTAINER Adam Brown "adamarthurryan@gmail.com"
# update package sources
# and get some basics
RUN apt-get -y update && apt-get -y install \
build-essential \
libssl-dev \
curl \
git
# install node.js
RUN curl -sL https://deb.nodesource.com/setup | bash -
RUN apt-get install -y nodejs
# install ruby
RUN apt-get install -y ruby1.9.1 ruby1.9.1-dev
# install wdiff
RUN apt-get install -y wdiff
# add a user
# and make them a sudoer
RUN useradd -ms /bin/bash docker && echo "docker:docker" | chpasswd && adduser docker sudo
# switch to the docker user
ENV HOME /home/docker
USER docker
# configure ruby gems to run from the home directory
ENV PATH $PATH:/home/docker/.gem/ruby/1.9.1/bin
# configure npm to run without sudo permissions
RUN echo 'prefix=${HOME}/.npm-packages' >> $HOME/.npmrc
ENV NPM_PACKAGES $HOME/.npm-packages
ENV NODE_PATH $NPM_PACKAGES/lib/node_modules:$NODE_PATH
ENV PATH $PATH:$NPM_PACKAGES/bin
ENV MANPATH $(manpath):$NPM_PACKAGES/share/man
# the home folder is a volume
# we can mount it to a data volume and then it will be shared with all instances
VOLUME /home/docker
# expose the ports
# EXPOSE 8000
# EXPOSE 9000
# EXPOSE 3000
# EXPOSE 35729

View File

@ -1,22 +0,0 @@
The MIT License (MIT)
Copyright (c) 2015 Adam Brown
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

View File

@ -1,23 +0,0 @@
# wdiff-markdown/docker
A docker container for deploying the wdiff-markdown application
Usage
======
Build the container with `docker build -t 'adamarthurryan/wdiff-markdown'`.
Run the script `prepare.sh` from this folder.
To launch the application in development mode, run `../launch-devel.sh`.
To launch the application in production mode, run `../launch-prod.sh`.
Note on DigitalOcean deployment
===============================
The DigitalOcean 512MB RAM option is not able to fully support dubdiff. In order to run dubdiff on this size of "droplet" one must enable a swapfile as described in this article:
(https://www.digitalocean.com/community/tutorials/how-to-add-swap-on-ubuntu-12-04)
1024K of swap works well.

View File

@ -1,16 +0,0 @@
#!/bin/bash
# default package installations
echo "run this script with 'mean bash default-packages.sh'"
# install some ruby gems
gem install --user-install sass
gem install --user-install compass
# install yeoman tooling and other npm packages
npm install -g node-gyp
npm install -g yo bower grunt-cli
npm install -g generator-webapp generator-angular generator-angular-fullstack generator-polymer

View File

@ -1,21 +0,0 @@
#!/bin/bash
# launch the mean docker container to execute a single command on the working directory
# the working directory will be mounted as /working in the docker container
# test if the data-docker-home container has been created
if docker inspect -f {{.Name}} data-docker-home > /dev/null
then
echo > /dev/null
else
echo "* creating data-docker-home container"
echo
# The data container has a volume at /home/docker, is named 'data' and is based on busybox
docker create -v /home/docker --name data-docker-home adamarthurryan/mean echo "Data container - docker home"
fi
echo Run this script from the project root folder!
docker run -it --rm --volumes-from=data-docker-home -v ${PWD}:/working -w /working -p 9000:9000 -p 35729:35729 adamarthurryan/mean grunt serve

View File

@ -1,21 +0,0 @@
#!/bin/bash
# launch the mean docker container to execute a single command on the working directory
# the working directory will be mounted as /working in the docker container
# test if the data-docker-home container has been created
if docker inspect -f {{.Name}} data-docker-home > /dev/null
then
echo > /dev/null
else
echo "* creating data-docker-home container"
echo
# The data container has a volume at /home/docker, is named 'data' and is based on busybox
docker create -v /home/docker --name data-docker-home adamarthurryan/mean echo "Data container - docker home"
fi
echo Run this script from the project root folder!
docker run --restart=always -it -e "PORT=8080" --volumes-from=data-docker-home -v ${PWD}:/working -w /working -p 8081:8080 adamarthurryan/mean grunt serve:dist

View File

@ -1,19 +0,0 @@
#!/bin/bash
# launch the mean docker container to execute a single command on the working directory
# the working directory will be mounted as /working in the docker container
# test if the data-docker-home container has been created
if docker inspect -f {{.Name}} data-docker-home > /dev/null
then
echo > /dev/null
else
echo "* creating data-docker-home container"
echo
# The data container has a volume at /home/docker, is named 'data' and is based on busybox
docker create -v /home/docker --name data-docker-home adamarthurryan/mean echo "Data container - docker home"
fi
docker run -it --rm --volumes-from=data-docker-home -v ${PWD}:/working -w /working adamarthurryan/mean bash default-packages.sh

View File

@ -14,9 +14,9 @@ temp.track();
// Perform a comparison between a and b
// the callback should have parameters (err, result)
module.exports = newversion
module.exports = jsdiffEngine
function newversion (a, b, asMarkdown, callback) {
function jsdiffEngine (a, b, asMarkdown, callback) {
//a few strings have to be escaped: "[-", "-]", "{+", and "+}"
@ -41,8 +41,6 @@ function newversion (a, b, asMarkdown, callback) {
//!!! this needs more sophisticated parsing
//console.log(stdout)
var markdown = unescapeString(rewriteWdiffMarkdown(diffStr))
resData.wdiff=markdown;
@ -51,14 +49,11 @@ function newversion (a, b, asMarkdown, callback) {
return callback(null, resData);
}
function oldversion (a, b, asMarkdown, callback) {
function wdiffEngine (a, b, asMarkdown, callback) {
//!!! this nested file-open is not a good pattern
// better would be to use promises and write the two files asynchronously
//console.log(a)
//console.log(escapeString(a))
//a few strings have to be escaped: "[-", "-]", "{+", and "+}"
a = escapeString(a)
b = escapeString(b)
@ -109,8 +104,6 @@ function oldversion (a, b, asMarkdown, callback) {
//!!! this needs more sophisticated parsing
//console.log(stdout)
var markdown = unescapeString(rewriteWdiffMarkdown(stdout))
resData.wdiff=markdown;