File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -21,10 +21,19 @@ RUN if [ ! -f .env ]; then \
2121RUN npm run build
2222
2323# ========= BUILD BACKEND =========
24+ # Backend build stage
2425FROM --platform=$BUILDPLATFORM golang:1.23.3 AS backend-build
2526
26- # Install Go public tools needed in runtime
27- RUN curl -fsSL https://raw.githubusercontent.com/pressly/goose/master/install.sh | sh
27+ # Make TARGET args available early so tools built here match the final image arch
28+ ARG TARGETOS
29+ ARG TARGETARCH
30+
31+ # Install Go public tools needed in runtime. Use `go install` for goose so the
32+ # binary is compiled for the target architecture instead of downloading a
33+ # prebuilt binary which may have the wrong architecture (causes exec format
34+ # errors on ARM).
35+ RUN env GOBIN=/usr/local/bin GOOS=${TARGETOS:-linux} GOARCH=${TARGETARCH:-amd64} \
36+ go install github.com/pressly/goose/v3/cmd/goose@latest
2837RUN go install github.com/swaggo/swag/cmd/
[email protected] 2938
3039# Set working directory
@@ -168,4 +177,4 @@ EXPOSE 4005
168177VOLUME ["/postgresus-data" ]
169178
170179ENTRYPOINT ["/app/start.sh" ]
171- CMD []
180+ CMD []
You can’t perform that action at this time.
0 commit comments