Skip to content

Commit

Permalink
dk ci
Browse files Browse the repository at this point in the history
  • Loading branch information
bookpanda committed Aug 14, 2024
1 parent cf31518 commit dd3fbbc
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
- name: Build and Push Docker Image
uses: docker/build-push-action@v3
with:
file: ./backend/Dockerfile
file: ./backend/Dockerfile.ci
push: true
tags: ${{ env.IMAGE_NAME }}:${{ github.ref_type == 'tag' && github.ref_name || github.sha }},${{ env.IMAGE_NAME }}:latest
cache-from: type=registry,ref=${{ env.IMAGE_NAME }}:buildcache
Expand Down
4 changes: 2 additions & 2 deletions backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
FROM golang:1.22.4-alpine3.20 as builder
WORKDIR /app

COPY ./backend/go.mod ./backend/go.sum ./
COPY go.mod go.sum ./

RUN go mod download

COPY ./backend/. .
COPY . .

RUN go build -o server ./cmd/main.go

Expand Down
22 changes: 22 additions & 0 deletions backend/Dockerfile.ci
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
FROM golang:1.22.4-alpine3.20 as builder
WORKDIR /app

COPY ./backend/go.mod ./backend/go.sum ./

RUN go mod download

COPY ./backend/. .

RUN go build -o server ./cmd/main.go


FROM alpine AS runner
WORKDIR /app

COPY --from=builder /app/server ./

ENV GO_ENV production

EXPOSE 3000

CMD ["./server"]

0 comments on commit dd3fbbc

Please sign in to comment.