Skip to main content

Posts

Showing posts from 2020

Docker multi-stage build in Action

Hi everyone, today I want to show how to create the small docker image for deploying the application. I've an application which consists of a backend(go application) and angular based front-end application. So let's create the Dockerfile and step by step fill it with commands. I started with frontend Next I added the golang builder For avoiding, the certificate signed by unknown authority error during HTTP request I add trusted certificates (details more here Stackoverflow issue ) Finally, copy all items to the end image I keep my container on the quay.io so everyone can see logs and pull the container docker pull quay.io/vdzundza/shoper All Dockerfile listing here Github Gist Thanks everyone !

Nginx rewrite rules for hosting angular(any) static app on subroute

Hi everyone, I decided to reorganise my personal blog and use it mostly as "Notes" Today, I want to host two websites served by golang application. The simplest solution is to create system service which points to go executable app on the particular port. In a nutshell, there are two separate services which use 9990 and 9991 ports. Next step I added this simple rule to the Nginx location /admin { rewrite /admin/(.*) /$1 break; proxy_pass http://localhost:9991; proxy_redirect off; proxy_set_header Host $host; } location / { proxy_pass http://localhost:9990; } So this simple configuration just rewrites URL properly to the admin service and I do not need to add extra `admin` route prefix. The latest step is set-up base href for the static `index.html` file. We can easily do it with build option `ng build --base-href /admin/` Thank everyone for reading.