This commit is contained in:
2026-04-27 22:36:44 +09:30
parent 86b6d6c0b9
commit 2d03f3a7f4
58 changed files with 4376 additions and 62 deletions
+53
View File
@@ -0,0 +1,53 @@
# Multi-stage build for MTG Search
# Stage 1: Build backend and frontend
FROM eclipse-temurin:21-jdk as builder
WORKDIR /build
# Install Node.js
RUN apt-get update && apt-get install -y curl && \
curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/*
# Copy gradle files
COPY gradle gradle
COPY gradlew .
COPY build.gradle.kts .
COPY settings.gradle.kts .
COPY gradle.properties .
# Copy backend source
COPY backend backend
# Copy frontend source
COPY frontend frontend
# Build backend
WORKDIR /build/backend
RUN ../gradlew build -x test
# Build frontend
WORKDIR /build/frontend
RUN npm ci && npm run build
# Stage 2: Runtime
FROM eclipse-temurin:21-jre
WORKDIR /app
# Install curl for health checks
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
# Copy built backend jar
COPY --from=builder /build/backend/build/libs/*.jar app.jar
# Expose port
EXPOSE 8080
# Health check
HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8080/api/v1/auth/health || exit 1
# Run application
ENTRYPOINT ["java", "-jar", "app.jar"]