diff --git a/docker/bb-spring/Dockerfile b/docker/bb-spring/Dockerfile new file mode 100644 index 0000000..399820d --- /dev/null +++ b/docker/bb-spring/Dockerfile @@ -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"] \ No newline at end of file diff --git a/docker-compose.yaml b/docker/docker-compose.yaml similarity index 100% rename from docker-compose.yaml rename to docker/docker-compose.yaml diff --git a/docker/ss_builder/Dockerfile b/docker/ss_builder/Dockerfile new file mode 100644 index 0000000..c9d0091 --- /dev/null +++ b/docker/ss_builder/Dockerfile @@ -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"] \ No newline at end of file diff --git a/src/main/java/group/goforward/ballistic/controllers/Dockerfile b/src/main/java/group/goforward/ballistic/controllers/Dockerfile new file mode 100644 index 0000000..399820d --- /dev/null +++ b/src/main/java/group/goforward/ballistic/controllers/Dockerfile @@ -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"] \ No newline at end of file