Version 3.4.0 of my Meteor app for following NFL weekly winners
This app uses Meteor, React, MongoDb and Semantic UI.
export MONGO_URL=mongodb://localhost:27017/footballer
Navigate to app root folder and type:
meteor
Run tests, open browser to localhost:3300 to view results:
meteor test --driver-package practicalmeteor:mocha --port 3300
meteor build ../build --server-only --architecture os.linux.x86_64
FROM node:4.8.2-alpine
MAINTAINER Tim Cooper <email address>
ENV BUILD_PACKAGES="python make gcc g++ git libuv bash curl tar bzip2" \
NODE_ENV=production \
ROOT_URL=http://localhost:3000 \
PORT=3000
WORKDIR /root/app/bundle
ADD footballer.tar.gz /root/app
RUN apk --update add ${BUILD_PACKAGES} \
&& (cd programs/server/ && npm install --unsafe-perm) \
&& apk --update del ${BUILD_PACKAGES}
EXPOSE 3000
CMD node main.js
docker build -t tjscooper/footballer:2.0.7 .
push "tjscooper/footballer" image to https://hub.docker.com/
docker push tjscooper/footballer:2.0.7
Using GUI...
ssh root@<IP ADDRESS OF DROPLET>
systemctl start docker
systemctl enable docker
systemctl status docker
docker pull mongo:3.2
docker run -d --restart=always -v /root/database/:/data/db --name mongodb mongo:3.2 mongod --smallfiles --nohttpinterface --replSet rs0
docker exec -it mongodb mongo
use admin
rs.initiate()
db.createUser({user: "oplogger", pwd: "footballer", roles: [{role: "read", db: "local"}]})
ssh <user>@<domain>
and enter password
docker pull tjscooper/footballer:2.0.6
ps -a
docker images
docker rm footballer -f
docker run -d -p 80:3000 --restart=always --link mongodb -e MONGO_URL=mongodb://mongodb:27017/footballer -e MONGO_OPLOG_URL=mongodb://oplogger:footballer@mongodb:27017/local?authSource=admin --name=footballer tjscooper/footballer:2.0.6
ssh <user>@<domain>
and enter password
docker ps
docker exec -it mongodb bash
mongo
them exit
cd /
mongodump -o /dump/
and then exit
docker cp mongodb:/dump .
and then exit
scp -r <user>@<domain>:/root/dump .
and enter password
mongorestore --drop --db footballer ./dump/footballer
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://localhost:8080;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
location /app2 {
proxy_pass http://localhost:8081;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
sudo nginx -t
sudo service nginx restart