Giter Site home page Giter Site logo

virtualstocks.io-gcp's Introduction

Code for Heroku server for virtualstocks.io

Generate Service Account Key

This step is necessary for node to be able to access firebase. Download the service account json file from Google Cloud Platform and store it as /keys/firebase.json.

See here for more details: https://firebase.google.com/docs/firestore/quickstart

Get SSL Certificates

Cloudflare > Crypto > Origin Certificates

Key: /keys/key.pem Cert: /keys/cert.pem

Google Cloud Platform Setup

Use Google Cloud Platform's free compute engine for free, scalable, reliable hosting.

Service File

/etc/systemd/system/virtualstocks.service

[Unit]
Description=VirtualStocks server

[Service]
ExecStart=/usr/bin/docker run --name=virtualstocks -p 443:443 thecodingwizard/virtualstocks
ExecStop=/usr/bin/docker stop virtualstocks
ExecStopPost=/usr/bin/docker rm virtualstocks
Restart=always
User=root
Group=nogroup  
Environment=PATH=/usr/bin:/usr/local/bin

[Install]
WantedBy=multi-user.target

Make sure to replace the docker registry URL with the appropriate command.

Copy to /etc/systemd/system. Start with systemctl start virtualstocks. Enable to run on boot with systemctl enable virtualstocks. See logs with journalctl -u virtualstocks.

https://stackoverflow.com/questions/4018154/how-do-i-run-a-node-js-app-as-a-background-service

Updating Docker

docker build -t virtualstocks .

docker tag virtualstocks thecodingwizard/virtualstocks

docker push thecodingwizard/virtualstocks

On GCP:

sudo systemctl stop virtualstocks

docker pull thecodingwizard/virtualstocks

sudo systemctl start virtualstocks

virtualstocks.io-gcp's People

Contributors

jsdelivrbot avatar thecodingwizard avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.