Spaces:
Runtime error
Runtime error
# ベースイメージとして Node.js を使用 | |
FROM node:18 | |
# 作業ディレクトリを設定 | |
WORKDIR /app | |
# ホストのファイルをコンテナにコピー | |
COPY . . | |
# Python 2.7 を手動インストール | |
RUN apt-get update && \ | |
apt-get install -y curl gcc make zlib1g-dev libssl-dev libffi-dev && \ | |
curl -O https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tgz && \ | |
tar xzf Python-2.7.18.tgz && \ | |
cd Python-2.7.18 && \ | |
./configure --prefix=/usr/local && \ | |
make && \ | |
make install && \ | |
ln -s /usr/local/bin/python2.7 /usr/bin/python2 && \ | |
cd .. && rm -rf Python-2.7.18 Python-2.7.18.tgz | |
RUN apt-get update && apt-get install -y python3 python3-pip default-jre | |
RUN apt-get update && \ | |
apt-get install -y git-lfs && \ | |
git lfs install | |
ARG github_token | |
# translations ディレクトリを作成し、権限を設定 | |
RUN mkdir -p /app/translations && chmod -R 777 /app/translations | |
RUN chmod -R 777 /app | |
# 依存関係をインストール(競合を無視) | |
RUN npm install --legacy-peer-deps | |
# scratch-blocks のビルド準備(ディレクトリ名変更を含む) | |
RUN cd node_modules/scratch-blocks && \ | |
npm install && \ | |
if [ -d "google-closure-library" ]; then mv google-closure-library closure-library; fi && \ | |
npm run prepublish | |
RUN cd node_modules/scratch-blocks && npm install && npm run prepublish | |
# OpenSSL の互換オプションを有効化 | |
ENV NODE_OPTIONS="--openssl-legacy-provider" | |
# コンテナの起動時にサーバーを実行 | |
CMD ["/bin/sh", "-c", "npm start"] | |
# コンテナがリッスンするポート | |
EXPOSE 3000 | |