Fake-Youtube-App / Dockerfile
soiz1's picture
Update Dockerfile
b16c9be verified
raw
history blame contribute delete
924 Bytes
# ベースイメージとしてNode.jsを使用
FROM node:18-alpine
# 作業ディレクトリを設定
WORKDIR /app
# 必要なツールをインストール
RUN apk add --no-cache git
RUN rm -rf node_modules
# リポジトリをクローン
RUN git clone https://github.com/Rzzvaan-Muhammad/Fake-Youtube-App.git .
# rootユーザーとして実行
USER root
# パーミッションを設定
RUN chown -R root:root /app
# postcssの互換性問題を解決
RUN npm install postcss@^8.4.14
# 依存関係をインストール
RUN npm install
RUN mkdir -p node_modules/.cache
RUN chmod -R 777 node_modules/.cache
# react-scriptsを最新に更新
RUN npm install react-scripts@latest
# 非rootユーザーに戻す
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
RUN chown -R appuser:appgroup /app
USER root
#ENV PATH="/app/"
# コンテナ起動時にアプリケーションを起動
CMD ["npm", "start"]