File size: 810 Bytes
012a13e
 
 
 
 
 
19693ad
c93288a
012a13e
 
 
1ca6599
012a13e
1ca6599
012a13e
 
 
 
 
 
1ca6599
012a13e
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# 1. Nodeでビルド
FROM node:18-alpine AS builder

RUN apk add --no-cache git python3 make g++ bash findutils
WORKDIR /app
COPY . .
RUN npm install @babel/runtime --save --legacy-peer-deps
RUN npm ci --no-audit --no-fund || npm install --no-audit --no-fund --legacy-peer-deps
RUN npm run build

RUN mkdir -p /build_output \
 && FILE=$(find . -type f -name "eruda-dom*.js" | grep -E "dist|build|lib|^\./eruda-dom" | head -n1) \
 && if [ -z "$FILE" ]; then echo "ビルド成果物が見つかりません"; exit 1; fi \
 && cp "$FILE" /build_output/eruda-dom.js

# 2. Python + Flask のランタイム
FROM python:3.11-slim
RUN pip install --no-cache-dir flask
WORKDIR /app

COPY --from=builder /build_output/eruda-dom.js /app/static/eruda-dom.js
COPY app.py /app/app.py

EXPOSE 7860
CMD ["python", "app.py"]