FROM gradle:8.9.0-jdk11 as builder
WORKDIR /app
COPY . .
RUN apt-get update && apt-get install -y \
build-essential \
nghttp2 \
libnghttp2-dev \
libssl-dev \
make \
g++ \
curl \
libpsl-dev \
libcurl4-openssl-dev \
libssl3 \
ca-certificates \
psl \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
RUN curl -o curl.tgz https://curl.se/download/curl-8.9.1.tar.gz
RUN tar xzvf curl.tgz && \
cd curl-*/ && \
./configure --prefix=/usr/local --with-openssl --enable-websockets --with-nghttp2 && \
make -j4 && make install && ldconfig
RUN cp -r /usr/local/lib/libcurl* /usr/lib/ && \
cp -r /usr/local/lib/libcurl* /usr/lib64 && \
cp -r /usr/local/include/curl/ /usr/include && \
cp -r /usr/local/lib/libcurl.a /usr/lib/libcurl.a && \
cp -r /usr/local/lib/libcurl.la /usr/lib/libcurl.la && \
cp -r /usr/local/lib/libcurl.so /usr/lib/libcurl.so && \
cp -r /usr/local/lib/libcurl.so.4 /usr/lib/libcurl.so.4 && \
cp -r /usr/local/lib/libcurl.so.4.8.0 /usr/lib/libcurl.so.4.8.0
ENV LD_LIBRARY_PATH=/usr/local/lib:/usr/lib:$LD_LIBRARY_PATH
RUN ./gradlew linkReleaseExecutableLinuxX64
RUN mv ./build/bin/linuxX64/releaseExecutable/Yu.kexe ./Yu && \
chmod +x ./Yu
CMD ["./Yu"]