Posts

Showing posts from March, 2022

Understanding a Dockerfile

Image
  Understanding a Dockerfile Dockerfile describes exactly how the docker image should be constructed. It is made up of various instructions such as  FROM, RUN, COPY, and WORKDIR. FROM : Image to use as its starting point. Our Image is based on ruby:2.6 RUN : Tells Docker to execute commands apt-get : Linux command to install software -y : Answers YES to any prompts -qq  : Enables QUIET mode to reduce printed output Installs nodejs - A prerequisite of running Rails  --no-install-recommends : Not to install other non essential packages We don't need sudo here because commands inside the container by default runs by root user COPY . /usr/src/app/  Copy all files from current directory (.) to /usr/src/app Copies Rails application into container at /usr/src/app Source path is depends on where our Dockerfile is located WORKDIR /usr/src/app :  Container default working directory is / Change working directory to /usr/src/app RUN bundle install :  Executes from...

Rails Application with Docker

Image
Creating Rails App We are creating a rails application without installing rails on our system Create a folder on machine where we want to create Rails app Linux  mkdir ~/docker_rails cd  ~/docker_rails Windows  mkdir docker_rails cd docker_rails Create docker container based on image ruby:2.6   docker run -i -t --rm -v ${PWD}:/usr/src/app ruby:2.6 bash   Where docker run creates a container -i -t OR  -it :    --rm : It's a throwaway container  -v Mounts volume to share local system with container  ${PWD} :  Unix environment variable pointed to current directory Windows user should give current directory path as below docker run -i -t --rm -v C:/Users/amrut/OneDrive/Desktop/Amruta/docker_rails :/usr/src/app ruby:2.6 bash   ${PWD}:/usr/src/app : Mount the current directory inside the container at /usr/src/app Ruby:2.6 Reference docker image bash   After running this command , we can see  root@05d3878962ce:/# This shows...

PERSONAL ACCESS TOKEN ON GITHUB

Image
  PERSONAL ACCESS TOKEN ON GITHUB  PURPOSE While doing git clone or git pull if you face and issue and getting below error  remote: Support for password authentication was removed on August 13, 2021. Please use a personal access token instead. You have to create a personal access token with your git handle. Authentic in terminal with this PAT ( personal access token) REASON While doing any git operation, now GitHub is  not accepting authentication with password  You need to add PAT. Follow below steps to create PAT and authenticate on your local machine STEPS  CREATE PERSONAL ACCESS TOKEN Login to GitHub from the browser. Go to Settings - > Developer setting -> Personal access token -> Create new token Authenticate Full out required fields Select expiration period We want to access the repository from the command line. For this don't forget to  select "repo" option Click "Generate token" Copy generated token. Your tokens are like your password...

RoR Deployment on Google Cloud Platform

Image
  Overview This application is a simple web application-based login form implemented with Ruby on Rails where Ruby is an interpreted, high level, object oriented programming language and Rails is a framework.  The application is deployed on Google Cloud Platform . Goals Application accepts username and password. For valid credentials, it displays a message “Login successful! You are logged in as (loggedin_username) ” Valid logged in users can log out successfully . Application accepts username and password. For invalid credentials, it displays a message “Authentication failed! Please enter correct credentials.” Specifications Programming language : Ruby  Web application framework : Rails (MVC) Deployment : Google Cloud Platform Source code : https://github.com/amrutapednekar/authentication_app Deployment on Google Cloud Platform New project Created a new project on Google Cloud Platform.  Open cloud shell terminal Clone application code Application code is cloned fro...

Introduction to PostgreSQL

Image
  Introduction to PostgreSQL CREATOR: Amruta Ashish Pednekar What is PostgresQL ? Database For   Storing Data Database system which stores data into tables for easy access Install PostgresQL  Go to https://www.postgresql.org/download/ Select your opening system family Download installer Click on downloaded installer and run as administrator Enter admin password. It will start installation. Click on NEXT button after every step It will ask you for a password for database superuser . Enter and note is somewhere for future use Check below option Finish installation Starting PGAdmin  Go to path where you installed PostgreSQL Go to <version> -> PGAdmin -> bin Open pgAdmin4 Set a master password for pgAdmin Connect to server Go to the left panel. Click on to servers Select server . Its PostgreSQL<version> Enter the same password you set while PostgreSQL installation Once you are connected to server, you can see other dropdowns like Tablespaces If you fac...