49 lines
1.0 KiB
Docker
49 lines
1.0 KiB
Docker
FROM eclipse-temurin:21-jdk-jammy
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends \
|
|
curl \
|
|
vim \
|
|
git \
|
|
unzip \
|
|
python3.11 \
|
|
ca-certificates \
|
|
ffmpeg && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
RUN ln -sf /usr/bin/python3.11 /usr/bin/python3
|
|
|
|
RUN curl -fsSL https://bun.sh/install > install.sh && \
|
|
chmod +x install.sh && \
|
|
./install.sh && \
|
|
rm install.sh
|
|
|
|
RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp -o /usr/local/bin/yt-dlp && \
|
|
chmod a+rx /usr/local/bin/yt-dlp
|
|
|
|
|
|
# Create non-root user
|
|
RUN groupadd --gid 1000 spring-app && \
|
|
useradd --uid 1000 --gid spring-app --shell /bin/bash --create-home spring-app
|
|
|
|
RUN mkdir -p /home/spring-app/.m2 && \
|
|
chown -R spring-app:spring-app /home/spring-app/.m2
|
|
|
|
WORKDIR /app
|
|
|
|
COPY mvnw .
|
|
COPY .mvn .mvn
|
|
COPY pom.xml .
|
|
COPY target target
|
|
|
|
RUN chmod +x mvnw && \
|
|
chown -R spring-app:spring-app /app
|
|
|
|
USER spring-app:spring-app
|
|
|
|
COPY src ./src
|
|
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["./mvnw", "spring-boot:run"]
|