티스토리 뷰

docker

[docker]container로 초기 react app 실행

수학소년 2023. 8. 12. 20:34

방법1. ubuntu 에.

docker run -it -p 3000:3000 --name ui ubuntu:20.04
apt-get update
apt-get install -y curl
apt-get install -y sudo
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo -E bash -
// curl -fsSL https://deb.nodesource.com/setup_lts.x | sudo -E bash -
// curl -fsSL https://deb.nodesource.com/setup_current.x | sudo -E bash -
apt-get install -y nodejs
node -v
npm -v
npm init react-app my-app

위 명령어까지 치면 "create-react-app@5.0.1" 설치할껀지 물어봄

y 입력하면 설치가 돼고 끝나면

cd my-app

npm start 치라고 나오는데,

react app을 실행하면 port 3000을 열어뒀기 때문에 접속됌

 

방법2. node 있는... 에.

.......

공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
TAG
more
«   2025/05   »
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
글 보관함