# stage 1: build frontend FROM node:24-alpine AS frontend WORKDIR /app/frontend COPY frontend/package.json frontend/bun.lockb* ./ RUN npm install -g bun && bun install COPY frontend/ ./ RUN bun run build # stage 2: build backend FROM golang:1.26-alpine AS backend WORKDIR /app COPY go.mod go.sum main.go ./ COPY auth/ ./auth/ COPY fetchers/ ./fetchers/ COPY general/ ./general/ COPY notes/ ./notes/ COPY --from=frontend /app/frontend/dist ./frontend/dist RUN go mod download RUN go build -o llostre . # stage 3: runtime FROM alpine:latest RUN apk add --no-cache ca-certificates WORKDIR /app COPY --from=backend /app/llostre . EXPOSE 8080 CMD ["./llostre"]