-
-
Notifications
You must be signed in to change notification settings - Fork 167
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
78352b6
commit 9d841f9
Showing
28 changed files
with
628 additions
and
271 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Docker | ||
on: push | ||
jobs: | ||
build: | ||
strategy: | ||
matrix: | ||
go-version: [1.22.x] | ||
platform: [ubuntu-latest] | ||
runs-on: ${{ matrix.platform }} | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
- name: Install Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: ${{ matrix.go-version }} | ||
cache: true | ||
cache-dependency-path: | | ||
**/go.sum | ||
internal/tool/go.sum | ||
- name: Images | ||
run: make docker |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
return { | ||
lsp_cfg = { | ||
settings = { | ||
gopls = { | ||
buildFlags = {"-tags=redis,rabbitmq,kafka"} | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,37 @@ | ||
FROM golang:1.23.4-bookworm AS builder | ||
|
||
# Explicitly NOT setting a default value | ||
ARG TAG | ||
|
||
WORKDIR /build/ | ||
|
||
COPY . . | ||
|
||
RUN go mod download | ||
ENV CGO_ENABLED=1 \ | ||
GOOS=linux | ||
|
||
RUN CGO_ENABLED=1 GOOS=linux go build -a -installsuffix cgo -ldflags "-extldflags -static" \ | ||
github.com/MarioCarrion/todo-api/cmd/rest-server | ||
RUN go mod download | ||
|
||
RUN CGO_ENABLED=1 GOOS=linux go install -a -installsuffix cgo -ldflags "-extldflags -static" \ | ||
github.com/jackc/tern/[email protected] | ||
RUN go build -a -installsuffix cgo -ldflags "-extldflags -static" -tags=$TAG \ | ||
github.com/MarioCarrion/todo-api/cmd/rest-server | ||
|
||
#- | ||
|
||
FROM debian:bookworm-20241223-slim | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN set -x && \ | ||
apt-get update && \ | ||
DEBIAN_FRONTEND=noninteractive apt-get install -y \ | ||
apt-get install -y \ | ||
ca-certificates && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /api/ | ||
ENV PATH=/api/bin/:$PATH | ||
|
||
COPY --from=builder /build/rest-server ./bin/rest-server | ||
COPY --from=builder /go/bin/tern ./bin/tern | ||
COPY --from=builder /build/env.example . | ||
COPY --from=builder /build/db/ . | ||
|
||
EXPOSE 9234 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
FROM golang:1.23.0-bookworm AS builder | ||
|
||
WORKDIR /build/ | ||
|
||
COPY db/ . | ||
|
||
COPY internal/tools/ . | ||
|
||
ENV CGO_ENABLED=1 \ | ||
GOOS=linux | ||
|
||
RUN go mod download && go mod tidy | ||
|
||
RUN go install -a -installsuffix cgo -ldflags "-extldflags -static" \ | ||
github.com/jackc/tern/v2 | ||
|
||
#- | ||
|
||
FROM debian:bookworm-20240812-slim | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN set -x && \ | ||
apt-get update && \ | ||
apt-get install -y \ | ||
ca-certificates && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
WORKDIR /db/ | ||
ENV PATH=/db/:$PATH | ||
|
||
COPY --from=builder /go/bin/tern . | ||
COPY --from=builder /build/migrations/ . | ||
|
||
CMD ["tern"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.