It was scary - I didn’t fully understand it, nor did I want to. I liked my processes: I liked writing code and running it on my machine, straight on the metal. I liked having to write long “READMEs” about how to install all the dependencies, dealing with my local install of Postgres, and fighting with orchestrating many different services locally. I honestly believed that it was like Kubernetes: over-engineered for most of my use cases, and couldn’t believe that people were actually using it. For one of my projects, I wanted to use Hasura. Unfortunately, the best way to use it was by using Docker. I bit the bullet and installed Docker Desktop. Hating every second of it, I coped the “docker-compose” file. With hate flowing through my fingertips, I typed the command “docker-compose up”. I waited (furiously) as docker began to pull images from the cloud. Spitefully, I laughed as the Postgres database and Hasura both launched seamlessly on my machine and began talking to eachother with no need for my intervention. Wait! What? That’s it? I just had to copy the docker-compose.yml file, run Docker-Compose up, and that’s it? I have my database and server running on my machine just like that? This has to be a prank. Login to PostgreSQL - sudo -u postgres psql In PostgreSQL interactive session enter - password postgres Create PostgreSQL database. sudo -u postgres psql To exit PostgreSQL session q Now set password for 'postgres' user. I typed “localhost:8080” in my chrome browser I was greeted by the Hasura admin screen. By default PostgreSQL installation creates a special user named 'postgres' that has all rights. I opened my DBAdmin (This isn’t sponsored, but I use TablePlus for Mac - much better then PHPMyAdmin.) and connected to my locally running postgres instance without a hiccup. I started a new project the other day, and I wanted to be able to orchistrate: I’ll admit, I’ve fallen a little off the deep end of docker lunacy. Imagine onboarding a new engineer onto this project without docker. I’d need to tell them that they should locally create two postgres databases, have node.js installed, and how to run the Cloud Functions in a daemon.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |