Dockerize configapi
parent
345f9c2669
commit
901653dc02
@ -0,0 +1,24 @@
|
||||
# build image
|
||||
FROM golang:1.15.0-alpine as builder
|
||||
|
||||
RUN apk update && apk upgrade && \
|
||||
apk add --no-cache bash git openssh
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Copy and download dependencies to cache them and faster build time
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download
|
||||
|
||||
COPY . .
|
||||
|
||||
# Test then build app
|
||||
RUN go build -v github.com/creekorful/trandoshan/cmd/tdsh-configapi
|
||||
|
||||
# runtime image
|
||||
FROM alpine:latest
|
||||
COPY --from=builder /app/tdsh-configapi /app/
|
||||
|
||||
WORKDIR /app/
|
||||
|
||||
ENTRYPOINT ["./tdsh-configapi"]
|
@ -0,0 +1,13 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"github.com/creekorful/trandoshan/internal/configapi"
|
||||
"os"
|
||||
)
|
||||
|
||||
func main() {
|
||||
app := configapi.GetApp()
|
||||
if err := app.Run(os.Args); err != nil {
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue