soiz1 commited on
Commit
208901c
·
verified ·
1 Parent(s): 4d70170

Create Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +25 -0
Dockerfile ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # 1. Nodeでビルド
2
+ FROM node:18-alpine AS builder
3
+
4
+ RUN apk add --no-cache git python3 make g++ bash findutils
5
+ WORKDIR /app
6
+ COPY . .
7
+ RUN npm install @babel/runtime --save
8
+ RUN npm ci --no-audit --no-fund || npm install --no-audit --no-fund
9
+ RUN npm run build
10
+
11
+ RUN mkdir -p /build_output \
12
+ && FILE=$(find . -type f -name "eruda-vue*.js" | grep -E "dist|build|lib|^\./eruda-vue" | head -n1) \
13
+ && if [ -z "$FILE" ]; then echo "ビルド成果物が見つかりません"; exit 1; fi \
14
+ && cp "$FILE" /build_output/eruda-vue.js
15
+
16
+ # 2. Python + Flask のランタイム
17
+ FROM python:3.11-slim
18
+ RUN pip install --no-cache-dir flask
19
+ WORKDIR /app
20
+
21
+ COPY --from=builder /build_output/eruda-vue.js /app/static/eruda-vue.js
22
+ COPY app.py /app/app.py
23
+
24
+ EXPOSE 7860
25
+ CMD ["python", "app.py"]