Setup React with Tailwind 2.0 on Cloud Run

Featuring an all-in-one shell script.

thoughtstile
2 min readFeb 9, 2021

Created on: 2021–02–09 15:41:21.

Step 1: Install Dependencies

npx create-react-app ./client &&
cd client &&
npm install tailwindcss@npm:@tailwindcss/postcss7-compat @tailwindcss/postcss7-compat postcss@^7 autoprefixer@^9 &&
npm install @craco/craco &&
curl 'https://gist.githubusercontent.com/thoughtstile/32737663cab5399e7adc03a911e1e989/raw/9c881b1b596c76766f0137eae740333bbda8b924/tailwind.config.js' -o tailwind.config.js &&
curl https://gist.githubusercontent.com/thoughtstile/192f81657c2593e664e8c6a6969ea700/raw/79447e17ddfdf2ec3909feae27177ec11b32bd68/craco.config.js -o craco.config.js &&
curl https://gist.githubusercontent.com/thoughtstile/95ca6c4df1b9f38e82703857f1d9e562/raw/013b41ecca8d067695df4ea4609ca1aef96f549b/index.css -o ./src/index.css &&
curl https://gist.githubusercontent.com/thoughtstile/5d4b56291b2f5aca60fd5c52763e9e07/raw/3cf89cace76e08220ec56629e380a20799e768ca/App.js -o ./src/App.js &&
cd .. &&
curl https://gist.githubusercontent.com/thoughtstile/660881b321ab8694ddfbe569a41a73e5/raw/f8178f98ffef15b05a5c17b0b5d8e61706cee9d3/Dockerfile -o ./client/Dockerfile &&
curl https://gist.githubusercontent.com/thoughtstile/2a6a761a6b91bf8b26838e5b522165a0/raw/7185c1308dd6633629d1a4264b3d62c3633f3993/nginx.conf -o ./client/nginx.conf &&
curl https://gist.githubusercontent.com/thoughtstile/3e1932f42d5b67bca1dbb034b2968349/raw/cbbac57a3d594a4295e42cd07885aecab61fb3fd/cloudbuild.yaml -o cloudbuild.yaml

--

--