# First Stage
FROM golang:1.24

RUN mkdir /app
ADD . /app/
WORKDIR /app
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o server .

# Second Stage
FROM alpine

# Fix: Alpine needs ca-certificates to verify Google API SSL certificates
RUN apk add --no-cache ca-certificates

# Copy from first stage
COPY --from=0 /app/server /app/server
COPY nearle-gear-firebase-adminsdk-l9oha-23ca3b3609.json /app/

WORKDIR /app

# Default startup command
CMD ["./server"]


