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
Percy11mo ago
Project ID: 7d08a38b-e23b-4509-99c3-611f6e44b300
aleksandar
aleksandar11mo ago
7d08a38b-e23b-4509-99c3-611f6e44b300
Adam
Adam11mo ago
Your build logs look fine, but what about your deployment logs?
aleksandar
aleksandar11mo 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
Brody11mo 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
aleksandar11mo ago
this is modified from this template https://github.com/FarazPatankar/pocketbase and it seems to work fine with hardcoded 8080
Brody
Brody11mo ago
try my dockerfile
aleksandar
aleksandar11mo ago
will do one sec same problem, now it just have a different port
aleksandar
aleksandar11mo 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
Brody11mo ago
no problem!
Want results from more Discord servers?
Add your server