# Dockerfile para o DEJO Node

FROM golang:1.20 as builder
WORKDIR /app

# Copiar arquivos e instalar dependências
COPY go.mod go.sum ./
RUN go mod download

COPY . .
RUN go build -o dejo-node ./cmd/main.go

# Criar imagem final
FROM debian:bullseye-slim
WORKDIR /root/

COPY --from=builder /app/dejo-node ./dejo-node

# Definir variáveis de ambiente padrão
ENV CONFIG_PATH="/config/config.yaml"

CMD ["./dejo-node"]