File size: 924 Bytes
23d51fa
 
 
 
 
 
 
df77941
23d51fa
a63b39f
23d51fa
646ffc8
 
 
 
 
42bb320
2533501
 
 
23d51fa
 
d0e796d
 
23d51fa
2533501
 
42bb320
646ffc8
 
 
c7f24dd
b16c9be
23d51fa
98b939e
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
# ベースイメージとして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"]