도커 설치 내용 추가 밎 SQL 설정 버그 해결 및 영상 생성 front단 Timeout 제거

main
Ubuntu 2025-12-17 06:42:11 +00:00
parent f5e7fba363
commit 9994944813
8 changed files with 911 additions and 11 deletions

View File

@ -2,11 +2,14 @@ FROM ubuntu:24.04
WORKDIR /app WORKDIR /app
ENV DEBIAN_FRONTEND=noninteractive
ENV NODE_ENV=production
# 시스템 패키지 설치 # 시스템 패키지 설치
RUN apt-get update && apt-get install -y \
RUN apt-get update && \
apt-get install -y software-properties-common && \
rm -rf /var/lib/apt/lists/*
RUN apt-get update && \
apt-get install -y \
curl \ curl \
wget \ wget \
gnupg \ gnupg \
@ -21,18 +24,32 @@ RUN apt-get update && apt-get install -y \
ffmpeg \ ffmpeg \
nodejs \ nodejs \
nginx \ nginx \
chromium \
chromium-browser \ chromium-browser \
certbot \ certbot \
python3-certbot-nginx \ python3-certbot-nginx \
&& rm -rf /var/lib/apt/lists/* && rm -rf /var/lib/apt/lists/*
RUN pip install requests cryptography flask flask_cors python-dotenv Pillow --break-system-packages RUN apt-get install -y wget
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - && \
sh -c 'echo "deb https://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
RUN apt update && apt install google-chrome-stable -y
RUN pip install requests cryptography flask flask_cors python-dotenv Pillow --break-system-packages --ignore-installed
# Node.js 및 npm 설치 # Node.js 및 npm 설치
RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \ RUN curl -fsSL https://deb.nodesource.com/setup_20.x | bash - && \
apt-get install -y nodejs && \ apt-get install -y nodejs && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
RUN apt-get update && apt-get install -y fonts-noto-cjk\
ca-certificates fonts-liberation libasound2t64 libatk-bridge2.0-0 libatk1.0-0 \
libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 \
libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 \
libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 \
libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release \
wget xdg-utils
# 포트 개방 # 포트 개방
EXPOSE 3000 3001 EXPOSE 3000 3001

View File

@ -241,7 +241,7 @@ const ResultPlayer: React.FC<ResultPlayerProps> = ({ assets, onReset, autoPlay =
const pollJobStatus = async (jobId: string) => { const pollJobStatus = async (jobId: string) => {
const token = localStorage.getItem('token'); const token = localStorage.getItem('token');
let pollCount = 0; let pollCount = 0;
const maxPolls = 180; // 최대 3분 (1초 간격) const maxPolls = 600; // 최대 3분 (1초 간격)
const poll = async () => { const poll = async () => {
if (pollCount >= maxPolls) { if (pollCount >= maxPolls) {

File diff suppressed because it is too large Load Diff

View File

@ -50,6 +50,7 @@
"clsx": "^2.1.1", "clsx": "^2.1.1",
"concurrently": "^9.2.1", "concurrently": "^9.2.1",
"postcss": "^8.5.6", "postcss": "^8.5.6",
"puppeteer": "^24.33.0",
"tailwind-merge": "^3.4.0", "tailwind-merge": "^3.4.0",
"tailwindcss": "^3.4.18", "tailwindcss": "^3.4.18",
"tailwindcss-animate": "^1.0.7", "tailwindcss-animate": "^1.0.7",

View File

@ -634,6 +634,7 @@ db.serialize(() => {
user_id INTEGER, user_id INTEGER,
business_name TEXT, business_name TEXT,
details TEXT, details TEXT,
final_video_path TEXT,
createdAt DATETIME DEFAULT CURRENT_TIMESTAMP, createdAt DATETIME DEFAULT CURRENT_TIMESTAMP,
FOREIGN KEY(user_id) REFERENCES users(id) FOREIGN KEY(user_id) REFERENCES users(id)
)`); )`);

View File

@ -2154,8 +2154,9 @@ async function processRenderQueue() {
// Puppeteer 녹화 // Puppeteer 녹화
const browser = await puppeteer.launch({ const browser = await puppeteer.launch({
executablePath: process.env.PUPPETEER_EXECUTABLE_PATH || '/usr/bin/google-chrome-stable',
headless: 'new', headless: 'new',
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-web-security'] args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-web-security','--disable-dev-shm-usage', '--disable-gpu']
}); });
const page = await browser.newPage(); const page = await browser.newPage();
@ -2397,8 +2398,9 @@ app.post('/render', authenticateToken, async (req, res) => {
// 3. Puppeteer로 영상 녹화 // 3. Puppeteer로 영상 녹화
const browser = await puppeteer.launch({ const browser = await puppeteer.launch({
executablePath: process.env.PUPPETEER_EXECUTABLE_PATH || '/usr/bin/google-chrome-stable',
headless: 'new', headless: 'new',
args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-web-security'] args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-web-security','--disable-dev-shm-usage', '--disable-gpu']
}); });
const page = await browser.newPage(); const page = await browser.newPage();
@ -7726,6 +7728,7 @@ app.post('/api/admin/sync/pensions', authenticateToken, requireAdmin, async (req
// 모든 기타 요청은 React 앱으로 전달 (SPA 라우팅 지원) // 모든 기타 요청은 React 앱으로 전달 (SPA 라우팅 지원)
app.get('*', (req, res) => { app.get('*', (req, res) => {
console.log("unknown req : ", req)
res.sendFile(path.join(__dirname, '../dist/index.html')); res.sendFile(path.join(__dirname, '../dist/index.html'));
}); });

View File

@ -60,7 +60,7 @@ const LibraryView: React.FC<LibraryViewProps> = ({
const [uploadPlatform, setUploadPlatform] = useState<'youtube' | 'instagram' | null>(null); const [uploadPlatform, setUploadPlatform] = useState<'youtube' | 'instagram' | null>(null);
const filteredItems = items.filter(item => const filteredItems = items.filter(item =>
item.businessName.toLowerCase().includes(searchQuery.toLowerCase()) item.businessName?.toLowerCase().includes(searchQuery.toLowerCase())
); );
// YouTube 업로드 // YouTube 업로드

View File

@ -13,14 +13,18 @@ services:
- ./local-data:/app/local-data - ./local-data:/app/local-data
environment: environment:
- NODE_ENV=development - NODE_ENV=development
- DEBIAN_FRONTEND=noninteractive
- PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
- PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome-stable
working_dir: /app/data working_dir: /app/data
restart: unless-stopped restart: unless-stopped
stdin_open: true stdin_open: true
tty: true tty: true
command: > command: >
bash -c " bash -c "
npm install -g --silent npm install -g --silent --legacy-peer-deps
cd server && npm install -g --silent cd server && npm install -g --silent --legacy-peer-deps
cd ../ cd ../
./start.sh ./start.sh
" "