-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
yusing
committed
Mar 31, 2024
1 parent
cbe23d2
commit 351bf84
Showing
8 changed files
with
151 additions
and
178 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 |
---|---|---|
@@ -1,20 +1,30 @@ | ||
FROM golang:1.22.1 as builder | ||
FROM alpine:latest AS codemirror | ||
RUN apk add --no-cache unzip wget make | ||
COPY Makefile . | ||
RUN make setup-codemirror | ||
|
||
COPY go.mod /app/go.mod | ||
COPY src/ /app/src | ||
COPY Makefile /app | ||
WORKDIR /app | ||
RUN make get | ||
RUN make build | ||
FROM golang:1.22.1-alpine as builder | ||
COPY src/ /src | ||
COPY go.mod go.sum /src/go-proxy | ||
WORKDIR /src/go-proxy | ||
RUN --mount=type=cache,target="/go/pkg/mod" \ | ||
go mod download | ||
|
||
ENV GOCACHE=/root/.cache/go-build | ||
RUN --mount=type=cache,target="/go/pkg/mod" \ | ||
--mount=type=cache,target="/root/.cache/go-build" \ | ||
CGO_ENABLED=0 GOOS=linux go build -pgo=auto -o go-proxy | ||
|
||
FROM alpine:latest | ||
|
||
LABEL maintainer="[email protected]" | ||
|
||
RUN apk add --no-cache tzdata | ||
COPY --from=builder /app/bin/go-proxy /app/ | ||
RUN mkdir -p /app/templates | ||
COPY --from=codemirror templates/codemirror/ /app/templates/codemirror | ||
COPY templates/ /app/templates | ||
COPY schema/ /app/schema | ||
COPY --from=builder /src/go-proxy /app/ | ||
|
||
RUN chmod +x /app/go-proxy | ||
ENV DOCKER_HOST unix:///var/run/docker.sock | ||
|
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.