diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..76c9895 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +target/ +node_modules/ +.env +.cpcache/ +.nrepl-port diff --git a/Dockerfile b/Dockerfile index 898c61f..557e886 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,21 @@ +FROM node:22-alpine AS css + +WORKDIR /build +COPY package.json package-lock.json ./ +RUN npm ci +COPY resources/css/ resources/css/ +COPY src/ src/ +COPY tailwind.config.js ./ +RUN npm run css:build + FROM clojure:openjdk-25 AS build WORKDIR /build +COPY deps.edn build.clj ./ +RUN clj -Sforce -P COPY . . -RUN clj -Sforce -T:build all +COPY --from=css /build/resources/public/css/output.css resources/public/css/output.css +RUN clj -T:build all FROM azul/zulu-openjdk-alpine:25 @@ -10,5 +23,6 @@ COPY --from=build /build/target/btcprice-standalone.jar /btcprice/btcprice-stand EXPOSE 4040 ENV PORT=4040 +ENV JDBC_URL=jdbc:postgresql://postgres:5432/btcprod CMD ["java", "-jar", "/btcprice/btcprice-standalone.jar"]