This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express') | |
const app = express() | |
const host = '0.0.0.0' | |
const port = 3666 | |
app.get('/', (req, res) => { | |
res.send('API v1.0') | |
}) | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useState, useEffect } from 'react' | |
function Profile({ user }) { | |
return ( | |
<div className='profile'> | |
<a className='name' href={user.github}> | |
<div>{user.name}</div> | |
</a> | |
<h4 className='role'>{user.role}</h4> | |
<p className='bio'>{user.bio}</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM node:15.5-alpine | |
LABEL MAINTAINER="gary.ascuy@gmail.com" | |
ENV NODE_ENV=production | |
WORKDIR /usr/app | |
EXPOSE 3666 | |
ADD ./src/app.js ./src/app.js | |
ADD ./package.json ./package.json | |
RUN yarn install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10.28.114.14 alejandra.vargas | |
10.28.114.15 alex.caceres | |
10.28.114.16 alvaro.torrez | |
10.28.114.17 ariel.arteaga | |
10.28.114.18 cristhian.arostegui | |
10.28.114.19 daniel.asin | |
10.28.114.20 gibran.jalil | |
10.28.114.21 gramsci.hermozo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Meteor } from 'meteor/meteor' | |
import { Persons } from '/imports/api/persons/persons' | |
Meteor.publish('Persons.byRole', function(role) { | |
check(role, String) | |
return Persons.find({role: role}, {fields: {name: 1}}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# puling todos image from public docker hub | |
docker pull meteorjs/todos:latest | |
# run meteor container | |
docker run -d -p 80:3000 --restart=always \ | |
--link mongodb \ | |
-e MONGO_URL=mongodb://mongodb:27017/todos \ | |
-e MONGO_OPLOG_URL=mongodb://oplogger:master@mongodb:27017/local?authSource=admin \ | |
--name=todos \ | |
meteorjs/todos:latest |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pull mongodb image from Docker hub | |
docker pull mongo:3.2 | |
# run mongodb container | |
docker run -d --restart=always \ | |
-v /root/database/:/data/db \ | |
--name mongodb \ | |
mongo:3.2 mongod --smallfiles --nohttpinterface --replSet rs0 | |
# configure replica set, and create oplog user |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Start docker service | |
systemctl start docker | |
# Enable docker service to start with OS on reboots | |
systemctl enable docker | |
# Verify docker service | |
systemctl status docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create a docker image from Dockerfile | |
docker build -t garyascuy/todos . | |
# push "garyascuy/todos" image to https://hub.docker.com/ | |
docker push garyascuy/todos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Dockerfile for Meteor App | |
FROM node:4.8.2-alpine | |
MAINTAINER Gary Ascuy <gary.ascuy@gmail.com> | |
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 |
NewerOlder