Skip to content

Instantly share code, notes, and snippets.

View Gary-Ascuy's full-sized avatar
🔥
Thinking ...

Gary Ascuy Gary-Ascuy

🔥
Thinking ...
View GitHub Profile
@Gary-Ascuy
Gary-Ascuy / vsinder.backend.app.js
Last active January 7, 2021 05:04
VSinder - Backend/app.js
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')
})
@Gary-Ascuy
Gary-Ascuy / vsinder.frontend.App.js
Last active January 7, 2021 05:04
VSinder - Frontend/App.js
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>
@Gary-Ascuy
Gary-Ascuy / vsinder.devops.Dockerfile
Last active January 7, 2021 05:05
VSinder - DevOps/Dockerfile
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
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
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}})
})
# 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
# 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
@Gary-Ascuy
Gary-Ascuy / docker_meteor_start_enable_docker.sh
Created May 2, 2017 01:46
Start and Enable docker service in CentOS
# Start docker service
systemctl start docker
# Enable docker service to start with OS on reboots
systemctl enable docker
# Verify docker service
systemctl status docker
# create a docker image from Dockerfile
docker build -t garyascuy/todos .
# push "garyascuy/todos" image to https://hub.docker.com/
docker push garyascuy/todos
@Gary-Ascuy
Gary-Ascuy / docker_meteor_clone_todos_app.Dockerfile
Created April 30, 2017 02:55
Dockefile template for Meteor application
# 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