Remove Docker stuff for now

This commit is contained in:
Jonathan Cremin 2015-08-23 19:12:59 +01:00
parent 8d64bb5270
commit f7bd32ab21
8 changed files with 13 additions and 48 deletions

View file

@ -1,2 +0,0 @@
.git
.env*

View file

@ -1,14 +0,0 @@
FROM kudoz/iojs-gm
MAINTAINER Jonathan Cremin <jonathan@crem.in>
WORKDIR /app
COPY . .
RUN npm install && npm rebuild node-sass
RUN npm run build
EXPOSE 4040
CMD npm start

View file

@ -1,5 +1,10 @@
# Hostr [![Circle CI](https://circleci.com/gh/kudos/hostr.svg?style=svg&circle-token=1b4dec62afcb7960446edf241a5cf9238b8c20ed)](https://circleci.com/gh/kudos/hostr)
## About
Hostr is a project I started almost ten years ago when I set out to learn web development. Since then it's seen over 100,000 signups and served up over 2 billion file downloads.
It has been through many iterations, but in its current incarnation Hostr is built using [Babel](https://babeljs.io/) and [Koa](http://koajs.com/). The frontend is built with Angular, for now.
## Getting Started
### Runtimes

2
app.js
View file

@ -17,8 +17,6 @@ import co from 'co';
import api from './api/app';
import { ws } from './api/app';
import web from './web/app';
import { init as storageInit } from './lib/storage';
storageInit();
import debugname from 'debug';
const debug = debugname('hostr');

View file

@ -2,7 +2,6 @@ machine:
services:
- docker
pre:
- curl https://raw.githubusercontent.com/creationix/nvm/v0.25.4/install.sh | bash
- npm install -g npm@3
node:
version: iojs-2.5.0
@ -12,13 +11,10 @@ test:
- mongo hostr test/fixtures/mongo-user.js test/fixtures/mongo-file.js
override:
- npm run cover
post:
- docker build -t $CIRCLE_PROJECT_REPONAME:$CIRCLE_BUILD_NUM . && docker save $CIRCLE_PROJECT_REPONAME:$CIRCLE_BUILD_NUM | gzip > $CIRCLE_ARTIFACTS/$CIRCLE_PROJECT_REPONAME-ci-build-$CIRCLE_BUILD_NUM.tar.gz
dependencies:
cache_directories:
- node_modules
- web/public/jspm_packages
post:
- ./node_modules/.bin/jspm config registries.github.auth $JSPM_GITHUB_AUTH_TOKEN
- ./node_modules/.bin/jspm install
- npm run jspm

View file

@ -1,16 +0,0 @@
web:
image: kudoz/hostr
env_file: .env-docker
links:
- redis
- mongo
ports:
- 443:4040
redis:
image: redis
ports:
- 6379:6379
mongo:
image: mongo
ports:
- 27017:27017

View file

@ -1,19 +1,19 @@
import fs from 'fs';
import path from 'path';
function range(start,stop) {
var result=[];
for (var idx=start.charCodeAt(0),end=stop.charCodeAt(0); idx <=end; ++idx){
function range(start, stop) {
var result = [];
for (var idx = start.charCodeAt(0), end = stop.charCodeAt(0); idx <= end; ++idx){
result.push(String.fromCharCode(idx));
}
return result;
};
}
const storePath = process.env.FILE_PATH || path.join(process.env.HOME, '.hostr', 'uploads');
const directories = range('A', 'Z').concat(range('a', 'z'), range('0', '9'));
export function init() {
export default function init() {
directories.forEach((directory) => {
if (!fs.existsSync(path.join(storePath, directory))) {
fs.mkdirSync(path.join(storePath, directory));

View file

@ -13,11 +13,11 @@
"build-js": "babel -D -m system -d web/public/build -i web/public web/public/src",
"build-sass": "node-sass -r -o web/public/styles/ web/public/styles/",
"cover": "istanbul cover _mocha -- --require babel/register test/**/*.spec.js",
"init": "babel-node init.js",
"init": "babel-node -e \"require('./lib/storage')();\"",
"jspm": "jspm install",
"start": "npm run build && babel-node app.js",
"test": "mongo hostr test/fixtures/mongo-user.js test/fixtures/mongo-file.js && mocha -r babel/register test/api test/web",
"watch": "parallelshell \"npm run watch-js\" \"npm run watch-server\" \"npm run watch-sass\"",
"watch": "parallelshell \"npm run watch-js\" \"npm run watch-sass\" \"npm run watch-server\"",
"watch-js": "babel -Dw -m system -d web/public/build web/public/src",
"watch-server": "nodemon -x \"babel-node\" app.js",
"watch-sass": "node-sass -w -r -o web/public/styles/ web/public/styles/"
@ -55,13 +55,11 @@
"koa-websocket": "~1.0.0",
"mandrill-api": "~1.0.45",
"mime-types": "~2.1.5",
"mkdirp": "~0.5.1",
"moment": "~2.10.6",
"mongodb-promisified": "~1.0.3",
"node-sass": "~3.2.0",
"node-uuid": "~1.4.3",
"passwords": "~1.3.0",
"pretty-error": "~1.2.0",
"raven": "~0.8.1",
"redis": "~0.12.1",
"redis-url": "~1.2.1",