Skip to content

Latest commit

 

History

History
54 lines (48 loc) · 3.19 KB

2018-Dec.md

File metadata and controls

54 lines (48 loc) · 3.19 KB

December 2018

  1. React app development environment REACT_APP NODE_ENV check if development or production

    • The “process.env.NODE_ENV” variable is set to “development” when running in development environment.
  2. C# XML and LINQ

  3. Openfaas setup

    • Docker should be present, this means there will be docker swarm also (which is required)
    • Install faas-cli : curl -sL https://cli.openfaas.com | sudo sh
    • Initialize docker swarm with: docker swarm init
    • Deploy stack
      • for linux 64bit: git clone https://github.com/openfaas/faas && cd faas && ./deploy_stack.sh
      • for rPi armhf: git clone https://github.com/openfaas/faas && cd faas && ./deploy_stack.armhf.sh
    • Login to faas-cli with the command shown
    • ~/.openfaas/config.yml contains the login information, the token property needs to be base64 decoded into username and password
  4. Creating Openfaas function

    • Openfaas functions are created from templates
    • Pull templates using: faas-cli template pull https://github.com/zeerorg/templates
    • Templates need to be present in the same folder. (could be improved)
    • Creating a function: faas-cli new function_name --lang {template_name}
    • Go into the function_name folder where you can edit files to deploy them
    • Inside the function_name.yml there are variables that can be tweeked.
  5. Creating Openfaas template

    • Every template has 2 parts: Dockerfile, function directory
    • The docker file contains the definition of a container that starts the watchdog service and defines necessary environment variables
    • The function directory contains the sample function, this function directory is copied to create a new function and the function edits the files inside directory.
    • Take examples from “https://github.com/zeerorg/templates” to write new templates
  6. Portainer Installation

    • docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer
  7. Ngrok windows server http asp net .net core

    • If bad request is there then host-header needs to change
    • ngrok http {port} -host-header="localhost:{port}"
  8. Asp .net server visual studio error : Unable to start IIS Server

    • This is due to ports and shit
    • Close visual studio then, Delete .vs/config/applicationsettings.json file, then open visual studio
  9. Docker Dockerfile (tags: creating dockerfile container new)

    • Add new user to docker container:
      • RUN useradd -ms /bin/bash newuser
      • Creates user and their directory, sets bash as default shell
    • Tini (tags: process docker)
    • Ubuntu Debian docker images
      • ENV DEBIAN_FRONTEND noninteractive
      • This sets the environment to non-interactive so that there are no prompts
      • Use “apt-get” over “apt” for installing packages
      • Use “apt-get clean” to remove cached packages
    • Search for arm images in https://hub.docker.com/u/arm32v7/