fabric-samples/asset-transfer-ledger-queries/chaincode-java/Dockerfile
SurbhiAgarwal1 36545ecb6b Fix #1148: Support CouchDB index deployment for Java chaincode
- Update packageCC.sh to correctly copy META-INF to the distribution directory.
- Port asset-transfer-ledger-queries to Java to provide a sample with rich query support.
- Ensure all Java chaincodes use src/main/resources/META-INF for standard index placement.

Signed-off-by: SurbhiAgarwal1 <agarwalsurbhi1807@gmail.com>
2026-04-16 05:37:44 +05:30

31 lines
979 B
Docker

# the first stage
FROM gradle:9-jdk25 AS gradle_build
# copy the build.gradle and src code to the container
COPY src/ src/
COPY build.gradle ./
# Build and package our code
RUN gradle --no-daemon build shadowJar -x checkstyleMain -x checkstyleTest
# the second stage of our build just needs the compiled files
FROM eclipse-temurin:25-jre
ARG CC_SERVER_PORT=9999
# Setup tini to work better handle signals
ENV TINI_VERSION=v0.19.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
RUN addgroup --system javauser && useradd -g javauser javauser
# copy only the artifacts we need from the first stage and discard the rest
COPY --chown=javauser:javauser --from=gradle_build /home/gradle/build/libs/chaincode.jar /chaincode.jar
COPY --chown=javauser:javauser docker/docker-entrypoint.sh /docker-entrypoint.sh
ENV PORT=$CC_SERVER_PORT
EXPOSE $CC_SERVER_PORT
USER javauser
ENTRYPOINT [ "/tini", "--", "/docker-entrypoint.sh" ]