mirror of
https://github.com/ktds-dg0501/kt-event-marketing.git
synced 2025-12-06 18:06:23 +00:00
Merge pull request #38 from ktds-dg0501/feature/distribution
Feature/distribution
This commit is contained in:
commit
9ce62738a1
@ -1,15 +1,40 @@
|
|||||||
# Multi-stage build for Spring Boot application
|
# Multi-stage build for Spring Boot application
|
||||||
FROM eclipse-temurin:21-jre-alpine AS builder
|
FROM eclipse-temurin:21-jre AS builder
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
COPY build/libs/*.jar app.jar
|
COPY build/libs/*.jar app.jar
|
||||||
RUN java -Djarmode=layertools -jar app.jar extract
|
RUN java -Djarmode=layertools -jar app.jar extract
|
||||||
|
|
||||||
FROM eclipse-temurin:21-jre-alpine
|
FROM eclipse-temurin:21-jre
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
# Create non-root user
|
# Install Playwright essential dependencies only
|
||||||
RUN addgroup -S spring && adduser -S spring -G spring
|
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||||
USER spring:spring
|
wget \
|
||||||
|
libnss3 \
|
||||||
|
libnspr4 \
|
||||||
|
libatk1.0-0 \
|
||||||
|
libatk-bridge2.0-0 \
|
||||||
|
libcups2 \
|
||||||
|
libdrm2 \
|
||||||
|
libdbus-1-3 \
|
||||||
|
libxkbcommon0 \
|
||||||
|
libxcomposite1 \
|
||||||
|
libxdamage1 \
|
||||||
|
libxfixes3 \
|
||||||
|
libxrandr2 \
|
||||||
|
libgbm1 \
|
||||||
|
libasound2t64 \
|
||||||
|
libpango-1.0-0 \
|
||||||
|
libcairo2 \
|
||||||
|
libatspi2.0-0 \
|
||||||
|
libxshmfence1 \
|
||||||
|
fonts-liberation \
|
||||||
|
libappindicator3-1 \
|
||||||
|
xdg-utils \
|
||||||
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Create browser installation directory with proper permissions
|
||||||
|
RUN mkdir -p /app/playwright && chmod 777 /app/playwright
|
||||||
|
|
||||||
# Copy layers from builder
|
# Copy layers from builder
|
||||||
COPY --from=builder /app/dependencies/ ./
|
COPY --from=builder /app/dependencies/ ./
|
||||||
@ -17,6 +42,17 @@ COPY --from=builder /app/spring-boot-loader/ ./
|
|||||||
COPY --from=builder /app/snapshot-dependencies/ ./
|
COPY --from=builder /app/snapshot-dependencies/ ./
|
||||||
COPY --from=builder /app/application/ ./
|
COPY --from=builder /app/application/ ./
|
||||||
|
|
||||||
|
# Set Playwright browsers path
|
||||||
|
ENV PLAYWRIGHT_BROWSERS_PATH=/app/playwright
|
||||||
|
|
||||||
|
# Create non-root user
|
||||||
|
RUN groupadd -r spring && useradd -r -g spring spring
|
||||||
|
|
||||||
|
# Change ownership to spring user
|
||||||
|
RUN chown -R spring:spring /app
|
||||||
|
|
||||||
|
USER spring:spring
|
||||||
|
|
||||||
# Health check
|
# Health check
|
||||||
HEALTHCHECK --interval=30s --timeout=3s --start-period=60s --retries=3 \
|
HEALTHCHECK --interval=30s --timeout=3s --start-period=60s --retries=3 \
|
||||||
CMD wget --no-verbose --tries=1 --spider http://localhost:8085/distribution/actuator/health || exit 1
|
CMD wget --no-verbose --tries=1 --spider http://localhost:8085/distribution/actuator/health || exit 1
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import com.kt.distribution.dto.ChannelType;
|
|||||||
import com.kt.distribution.dto.DistributionRequest;
|
import com.kt.distribution.dto.DistributionRequest;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
@ -20,6 +21,7 @@ import java.util.UUID;
|
|||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
@RequiredArgsConstructor
|
@RequiredArgsConstructor
|
||||||
|
@ConditionalOnProperty(name = "naver.blog.enabled", havingValue = "true", matchIfMissing = false)
|
||||||
public class NaverAdapter extends AbstractChannelAdapter {
|
public class NaverAdapter extends AbstractChannelAdapter {
|
||||||
|
|
||||||
private final NaverBlogClient naverBlogClient;
|
private final NaverBlogClient naverBlogClient;
|
||||||
|
|||||||
@ -5,6 +5,7 @@ import com.microsoft.playwright.*;
|
|||||||
import com.microsoft.playwright.options.LoadState;
|
import com.microsoft.playwright.options.LoadState;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
import jakarta.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
@ -23,6 +24,7 @@ import java.nio.file.Paths;
|
|||||||
*/
|
*/
|
||||||
@Slf4j
|
@Slf4j
|
||||||
@Component
|
@Component
|
||||||
|
@ConditionalOnProperty(name = "naver.blog.enabled", havingValue = "true", matchIfMissing = false)
|
||||||
public class NaverBlogClient {
|
public class NaverBlogClient {
|
||||||
|
|
||||||
@Value("${naver.blog.username:}")
|
@Value("${naver.blog.username:}")
|
||||||
|
|||||||
@ -126,6 +126,7 @@ channel:
|
|||||||
# Naver Blog Configuration (Playwright 기반)
|
# Naver Blog Configuration (Playwright 기반)
|
||||||
naver:
|
naver:
|
||||||
blog:
|
blog:
|
||||||
|
enabled: ${NAVER_BLOG_ENABLED:false}
|
||||||
username: ${NAVER_BLOG_USERNAME:}
|
username: ${NAVER_BLOG_USERNAME:}
|
||||||
password: ${NAVER_BLOG_PASSWORD:}
|
password: ${NAVER_BLOG_PASSWORD:}
|
||||||
blog-id: ${NAVER_BLOG_ID:}
|
blog-id: ${NAVER_BLOG_ID:}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user