Skip to content
This repository has been archived by the owner on Oct 24, 2024. It is now read-only.

Update dockerfile template and add env based dep-svc init #17

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,13 @@ import (
func main() {
app := gofr.NewCMD()

app.AddHTTPService("deployment-service", "https://api.stage.kops.dev")
zopAPI := "http://localhost:9005"

if app.Config.Get("DEP_ENV") == "PRODUCTION" {
zopAPI = "https://api.kops.dev"
}

app.AddHTTPService("deployment-service", zopAPI)

dClient := depClient.New()
depSvc := deploySvc.New(dClient)
Expand Down
23 changes: 18 additions & 5 deletions service/deploy/templates.go
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
package deploy

const (
Golang = `FROM alpine:latest
RUN apk add --no-cache tzdata ca-certificates
COPY main ./main
RUN chmod +x /main
EXPOSE {{ . }}
Golang = `FROM golang:1.22 AS builder

WORKDIR /app

COPY . .

RUN go mod tidy

RUN GOOS=linux GOARCH=amd64 go build -o main

FROM alpine:3.15

COPY --from=builder /app /

RUN chmod 777 /main

EXPOSE 9000

CMD ["/main"]`

Js = `FROM node:10-alpine
Expand Down
Loading