DEV Community

Potchara Pruksasri
Potchara Pruksasri

Posted on

Go: Deploy Go (Gin) Application on Docker

ตัวอย่างกันลืมของ Dockerfile ที่เอาไว้ Deploy Go Application โดยการ Clone จาก Private github ไปบน Docker (Portainer)

FROM golang

WORKDIR /app

RUN git clone -b develop https://<username>:<token>@github.com/<username>/<gitrepo>.git .

RUN go mod download

ENV GIN_MODE=release

COPY ./ ./

RUN go install github.com/cosmtrek/air@latest

# Don't forget to add .air.toml .gitignore
RUN air init

EXPOSE 8888

CMD ["air"]
Enter fullscreen mode Exit fullscreen mode

Top comments (0)