Merge pull request #103 from mozilla/docker

added Dockerfile
This commit is contained in:
Danny Coates 2017-06-21 08:44:03 -07:00 committed by GitHub
commit 37f74cacfa
8 changed files with 893 additions and 447 deletions

4
.dockerignore Normal file
View File

@ -0,0 +1,4 @@
node_modules
.git
.DS_Store
static

11
Dockerfile Normal file
View File

@ -0,0 +1,11 @@
FROM node:8-alpine
COPY . /app
WORKDIR /app
RUN mkdir static
RUN npm install
ENV PORT=1443
EXPOSE $PORT
CMD ["npm", "start"]

View File

@ -2,3 +2,10 @@ machine:
node: node:
version: 8.0.0 version: 8.0.0
deployment:
latest:
branch: master
commands:
- docker login -e $DOCKER_EMAIL -u $DOCKER_USER -p $DOCKER_PASS
- docker build . -t mozilla/portal:latest
- docker push mozilla/portal:latest

12
docker-compose.yml Normal file
View File

@ -0,0 +1,12 @@
version: "3"
services:
web:
build: .
links:
- redis
ports:
- "1443:1443"
environment:
- P2P_REDIS_HOST=redis
redis:
image: redis:alpine

10
docs/docker.md Normal file
View File

@ -0,0 +1,10 @@
Environment Variables:
PORT - port the server will listen on (defaults to 1443)
P2P_S3_BUCKET - the S3 bucket name
P2P_REDIS_HOST - host name of the redis server
NODE_ENV - production
Example
docker run --net=host -e 'NODE_ENV=production' -e 'P2P_S3_BUCKET=testpilot-p2p-dev' -e 'P2P_REDIS_HOST=dyf9s2r4vo3.bolxr4.0001.usw2.cache.amazonaws.com' mozilla/portal:latest

1292
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -49,7 +49,7 @@
"lint:css": "stylelint 'public/*.css'", "lint:css": "stylelint 'public/*.css'",
"lint:html": "htmllint 'views/*.handlebars'", "lint:html": "htmllint 'views/*.handlebars'",
"lint:js": "eslint .", "lint:js": "eslint .",
"start": "watchify frontend/src/main.js -o public/bundle.js -d | cross-env NODE_ENV=production node server/portal_server.js", "start": "browserify frontend/src/main.js -o public/bundle.js -d | cross-env NODE_ENV=production node server/portal_server.js",
"test": "mocha" "test": "mocha"
} }
} }

View File

@ -20,7 +20,7 @@ const conf = convict({
format: 'port', format: 'port',
default: 1443, default: 1443,
arg: 'port', arg: 'port',
env: 'P2P_LISTEN_PORT' env: 'PORT'
}, },
env: { env: {
format: ['production', 'development', 'test'], format: ['production', 'development', 'test'],