Add Docker build and deploy pipeline
All checks were successful
deploy-backend / deploy (push) Successful in 8m24s
All checks were successful
deploy-backend / deploy (push) Successful in 8m24s
This commit is contained in:
18
Dockerfile
Normal file
18
Dockerfile
Normal file
@@ -0,0 +1,18 @@
|
||||
FROM eclipse-temurin:25-jdk AS build
|
||||
WORKDIR /app
|
||||
COPY . .
|
||||
RUN sed -i 's/\r$//' gradlew \
|
||||
&& chmod +x gradlew \
|
||||
&& ./gradlew bootJar --no-daemon -x test \
|
||||
&& cp "$(ls build/libs/*.jar | grep -v plain | head -n1)" /app/app.jar
|
||||
|
||||
FROM eclipse-temurin:25-jre
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y --no-install-recommends ffmpeg \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& useradd -r -u 1001 app
|
||||
WORKDIR /app
|
||||
COPY --from=build /app/app.jar app.jar
|
||||
USER app
|
||||
EXPOSE 8080
|
||||
ENTRYPOINT ["java", "-Xmx768m", "-jar", "app.jar"]
|
||||
Reference in New Issue
Block a user