Trying to deploy golang app, and unable to see error

I'm trying to deploy a custom golang app using Dockerfile, build logs shows that everything is fine but I'm getting "Application failed to respond". Is there any way to get an errog log and figure out whats wrong?
Solution:
```dockerfile FROM golang:latest AS build-backend WORKDIR /app ...
Jump to solution
11 Replies
Percy
Percy12mo ago
Project ID: 7d08a38b-e23b-4509-99c3-611f6e44b300
aleksandar
aleksandarOP12mo ago
7d08a38b-e23b-4509-99c3-611f6e44b300
Adam
Adam12mo ago
Your build logs look fine, but what about your deployment logs?
aleksandar
aleksandarOP12mo ago
Also fine, same as similar project I have deployed for some time. This one have a little different Dockerfile but I can't seem to see whats wrong
FROM golang:latest AS build-backend

RUN mkdir /app
ADD . /app
WORKDIR /app

RUN CGO_ENABLED=0 GOOS=linux go build -o pb-custom .

FROM alpine:latest AS production
COPY --from=build-backend /app /pb/
EXPOSE 8080
CMD ["/pb/pb-custom", "serve", "--http=0.0.0.0:8080"]
FROM golang:latest AS build-backend

RUN mkdir /app
ADD . /app
WORKDIR /app

RUN CGO_ENABLED=0 GOOS=linux go build -o pb-custom .

FROM alpine:latest AS production
COPY --from=build-backend /app /pb/
EXPOSE 8080
CMD ["/pb/pb-custom", "serve", "--http=0.0.0.0:8080"]
Solution
Brody
Brody12mo ago
FROM golang:latest AS build-backend

WORKDIR /app

COPY . ./

RUN CGO_ENABLED=0 GOOS=linux go build -o pb-custom .

FROM alpine:latest AS production

COPY --from=build-backend /app /pb/

CMD /pb/pb-custom serve --http=0.0.0.0:$PORT
FROM golang:latest AS build-backend

WORKDIR /app

COPY . ./

RUN CGO_ENABLED=0 GOOS=linux go build -o pb-custom .

FROM alpine:latest AS production

COPY --from=build-backend /app /pb/

CMD /pb/pb-custom serve --http=0.0.0.0:$PORT
aleksandar
aleksandarOP12mo ago
this is modified from this template https://github.com/FarazPatankar/pocketbase and it seems to work fine with hardcoded 8080
Brody
Brody12mo ago
try my dockerfile
aleksandar
aleksandarOP12mo ago
will do one sec same problem, now it just have a different port
aleksandar
aleksandarOP12mo ago
just a sec I've removed env variables from project settings and now its working seems to have been some collision there but I'm using your Dockerfile so thanks a lot!
Brody
Brody12mo ago
no problem!
Want results from more Discord servers?
Add your server