Skip to content

Commit

Permalink
Adds Dockerfiles for API and Db migration & Update deployment flow
Browse files Browse the repository at this point in the history
Signed-off-by: Shivam Mukhade <smukhade@redhat.com>
  • Loading branch information
SM43 committed Feb 8, 2021
1 parent 3d3e51d commit d911d5f
Show file tree
Hide file tree
Showing 24 changed files with 166 additions and 119 deletions.
2 changes: 0 additions & 2 deletions api/.ko.yaml

This file was deleted.

18 changes: 18 additions & 0 deletions api/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
FROM golang:1.15-alpine3.12 AS builder

WORKDIR /go/src/github.com/tektoncd/hub/api
COPY . .

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o api-server ./cmd/api/...

FROM alpine:3.12

RUN apk --no-cache add git ca-certificates && addgroup -S hub && adduser -S hub -G hub
USER hub

WORKDIR /app
COPY --from=builder /go/src/github.com/tektoncd/hub/api/gen/http/openapi3.yaml /app/gen/http/openapi3.yaml
COPY --from=builder /go/src/github.com/tektoncd/hub/api/api-server /app/api-server
EXPOSE 8000

CMD [ "/app/api-server" ]
17 changes: 17 additions & 0 deletions api/db.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
FROM golang:1.15-alpine3.12 AS builder

WORKDIR /go/src/github.com/tektoncd/hub/api
COPY . .

RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -o db-migration ./cmd/db/...

FROM alpine:3.12

RUN apk --no-cache add ca-certificates && addgroup -S hub && adduser -S hub -G hub
USER hub

WORKDIR /app
COPY --from=builder /go/src/github.com/tektoncd/hub/api/db-migration /app/db-migration
EXPOSE 8000

CMD [ "/app/db-migration" ]
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ spec:
spec:
containers:
- name: db-migration
image: ko://github.com/tektoncd/hub/api/cmd/db
image: quay.io/tekton-hub/db-migration
env:
- name: POSTGRES_HOST
value: db
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ spec:
spec:
containers:
- name: api
image: ko://github.com/tektoncd/hub/api/cmd/api
image: quay.io/tekton-hub/api
ports:
- containerPort: 8000
readinessProbe:
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit d911d5f

Please sign in to comment.