Docker Image
docker run --rm -it -p 3002:3000 -p 9229:9229 -v "$PWD:/app" -w /app -u node --name ss-react --hostname ss-react -e REACT_APP_ALGOLIA_APP_ID=VFOOF4G2CG -e REACT_APP_ALGOLIA_SEARCH_API_KEY=0255332a76fd8a4c799f5bd16191b223 -e REACT_APP_AUTH_URL=https://staging-user.thesolesupplier.co.uk -e REACT_APP_PROFILE_URL=https://staging-user.thesolesupplier.co.uk -e REACT_APP_ALGOLIA_INDEX=production_data_posts_phase_2 -e REACT_APP_ALGOLIA_SCRAPER_INDEX=hackney_production_aggregated -e REACT_APP_BUG_REPORT_PATH=bug-report -e REACT_APP_ALGOLIA_BRANDS_INDEX=production_data_terms_phase_2 -e REACT_APP_FACEBOOK_API_KEY=794104823958795 -e REACT_APP_APPLE_APP_ID=1436712793 -e REACT_APP_GTM=GTM-M26HFP5 -e REACT_APP_CLEVERTAP_ID=TEST-Z67-KKK-9K5Z -e REACT_APP_ZENDESK_API=https://thesolesupplier -e REACT_APP_SCRAPER_FIELDS="url,normalized_sizes,price,currency,discount_code,stock" -e REACT_APP_SCRAPER_AFFILIATES=1 -e REACT_APP_GDPR= -e REACT_APP_LATEST_PRODUCTS_BRANDS="brand:nike,brand:adidas" node:10 bash
Install everything just once by using the following commnand
yarn install
Use this special Docker Image to create a Server with no variables to test for SSR
docker run --rm -it -v "$PWD:/app" -w /app -u node --name ss-react-build --hostname ss-react-build node:10 bash
yarn run start:debug
If you would like to run using QA Index use this command instead once inside the container
REACT_APP_ALGOLIA_SEARCH_API_KEY=d046c7dccc4d6b59f1d57ea80e4f0a41 REACT_APP_ALGOLIA_INDEX=qa_data_posts_phase_2 REACT_APP_ALGOLIA_BRANDS_INDEX=qa_data_terms_phase_2 yarn run start:debug
Update 21 Jul 2019
You should start using HTTPS in order to test API connections
HTTPS=true yarn run start:debug
yarn build
followed by
yarn start:server
Localhost: http://localhost:3002/