File size: 1,839 Bytes
c390d22
 
 
 
 
 
 
 
 
 
 
 
6570c11
 
 
 
c390d22
 
7f0cd59
6570c11
c390d22
601bdb1
c390d22
 
 
 
6570c11
c390d22
 
 
6570c11
 
 
 
 
 
 
6e76236
 
 
 
6570c11
 
 
c390d22
 
 
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# ベースイメージとして Node.js を使用
FROM node:20.18.1

# 作業ディレクトリを設定
WORKDIR /app

# ホストのファイルをコンテナにコピー
COPY . .
#RUN npm install -g pnpm
# translations ディレクトリを作成し、権限を設定
RUN mkdir -p /app/translations && chmod -R 777 /app/translations
RUN chmod -R 777 /app
RUN chmod +x static-upload.sh
RUN mkdir -p /app/translations/messages && chmod -R 777 /app/translations
RUN apt-get update && apt-get install -y python3 python3-pip
RUN pip3 install --upgrade huggingface_hub --break-system-packages
# 依存関係をインストール(競合を無視)
#RUN PNPM_SKIP_BUILDS_APPROVAL=true pnpm install --prefer-offline --strict-peer-dependencies=false
RUN npm config set registry https://registry.npmjs.org/

RUN npm install --prefer-offline --no-audit --legacy-peer-deps
RUN npm install --save-dev @svgr/webpack@5

# OpenSSL の互換オプションを有効化
#ENV NODE_OPTIONS="--openssl-legacy-provider"
RUN sed -i 's/\$PORT/3000/g' package.json

#RUN PNPM_SKIP_BUILDS_APPROVAL=true pnpm install scratch-vm@git+https://huggingface.co/datasets/soiz1/s4s-vm
RUN npm install scratch-vm@git+https://huggingface.co/datasets/soiz1/s4s-vm
# コンテナの起動時にサーバーを実行
ENV BUILD_MODE=dist
# translations/messages ディレクトリを作成し、権限を設定
RUN mkdir -p /app/translations/messages && chmod -R 777 /app/translations
RUN chmod -R 777 /app
RUN export NODE_OPTIONS="--max-old-space-size=12288"
ENV NODE_OPTIONS="--max-old-space-size=12288"

RUN mkdir -p /app/translations/messages \
    && chmod -R 777 /app/translations/messages \
    && chmod -R 777 /app
    
RUN NODE_OPTIONS=--openssl-legacy-provider npm run build 

CMD BUILD_MODE=dist npm start

# コンテナがリッスンするポート
EXPOSE 3000