How to deploy simple web app to azure using Local Git


(Ahmed Osman) #1

I’ve been trying to deploy my web app, I’ve tried using docker, but struggling with dockerfile configuration. So I decided to deploy to Azure using Local Git, still having trouble. Here’s the repo with my web app https://github.com/AOhassan/GoSystemOfEquations


(Lutz Horn) #2

I’ve dockerized your application, see https://github.com/lutzhorn/GoSystemOfEquations/tree/dockerize

Noteworthy things:

  • I’ve removed the /src directory.
  • The Go application is compiled to a static binary app, see Makefile.
  • The Docker image starts from scratch, no OS is used.
  • The static binary and the template directory are copied to the empty image, see Dockerfile.

Build everything using make:

$ make all

The build container can be run like this:

$ docker run -p 8080:8080 --rm app

I did not publish the image to a Docker repository and I did not try to run it at Azure.


(Ahmed Osman) #3

Thanks, I’ll trying to deploy to azure and keep you updated.


(Ahmed Osman) #4

It all works and runs until I visit my localhost it shows this. Here are the pics.
Heres my file structure.


Didn’t let me serve on localhost 8080 so I switched to 8084

It ran and then this happens

If you need more info, please tell me


(Ahmed Osman) #5

Found and fixed the problem. it was the / before my template. when serving it hahaha