FROM clojure:temurin-21-tools-deps AS builder
WORKDIR /app
COPY deps.edn build.clj ./
COPY shared/ shared/
COPY api/ api/
RUN clj -T:build uber :module api

FROM eclipse-temurin:21-jre-alpine
WORKDIR /app
COPY --from=builder /app/api/target/api.jar app.jar
EXPOSE 3001
CMD ["java", "-jar", "app.jar"]
