mirror of
https://gitea.gofwd.group/Forward_Group/ballistic-builder-spring.git
synced 2025-12-06 02:56:44 -05:00
docker...
This commit is contained in:
17
docker/bb-spring/Dockerfile
Normal file
17
docker/bb-spring/Dockerfile
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Stage 1: Build the application
|
||||||
|
FROM openjdk:17-jdk-slim as build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY gradlew .
|
||||||
|
COPY settings.gradle .
|
||||||
|
COPY build.gradle .
|
||||||
|
COPY src ./src
|
||||||
|
# Adjust the build command for Maven: ./mvnw package -DskipTests
|
||||||
|
RUN ./gradlew bootJar
|
||||||
|
|
||||||
|
# Stage 2: Create the final lightweight image
|
||||||
|
FROM openjdk:17-jre-slim
|
||||||
|
WORKDIR /app
|
||||||
|
# Get the built JAR from the build stage
|
||||||
|
COPY --from=build /app/build/libs/*.jar app.jar
|
||||||
|
EXPOSE 8080
|
||||||
|
ENTRYPOINT ["java", "-jar", "app.jar"]
|
||||||
22
docker/ss_builder/Dockerfile
Normal file
22
docker/ss_builder/Dockerfile
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
# Stage 1: Build the static assets
|
||||||
|
FROM node:20-alpine as builder
|
||||||
|
WORKDIR /app
|
||||||
|
COPY package.json package-lock.json ./
|
||||||
|
RUN npm install
|
||||||
|
COPY . .
|
||||||
|
# Run the Next.js build command
|
||||||
|
RUN npm run build
|
||||||
|
|
||||||
|
# Stage 2: Run the production application (Next.js server)
|
||||||
|
FROM node:20-alpine
|
||||||
|
WORKDIR /app
|
||||||
|
# Copy only the necessary files for running the app
|
||||||
|
COPY --from=builder /app/.next ./.next
|
||||||
|
COPY --from=builder /app/node_modules ./node_modules
|
||||||
|
COPY --from=builder /app/package.json ./package.json
|
||||||
|
COPY --from=builder /app/public ./public
|
||||||
|
# Set environment variables
|
||||||
|
ENV NODE_ENV production
|
||||||
|
EXPOSE 3000
|
||||||
|
# Run the Next.js production server
|
||||||
|
CMD ["npm", "start"]
|
||||||
@@ -0,0 +1,17 @@
|
|||||||
|
# Stage 1: Build the application
|
||||||
|
FROM openjdk:17-jdk-slim as build
|
||||||
|
WORKDIR /app
|
||||||
|
COPY gradlew .
|
||||||
|
COPY settings.gradle .
|
||||||
|
COPY build.gradle .
|
||||||
|
COPY src ./src
|
||||||
|
# Adjust the build command for Maven: ./mvnw package -DskipTests
|
||||||
|
RUN ./gradlew bootJar
|
||||||
|
|
||||||
|
# Stage 2: Create the final lightweight image
|
||||||
|
FROM openjdk:17-jre-slim
|
||||||
|
WORKDIR /app
|
||||||
|
# Get the built JAR from the build stage
|
||||||
|
COPY --from=build /app/build/libs/*.jar app.jar
|
||||||
|
EXPOSE 8080
|
||||||
|
ENTRYPOINT ["java", "-jar", "app.jar"]
|
||||||
Reference in New Issue
Block a user