Lollipops - easy and clear React/Redux/Docker boilerplate:
- react
- redux
- sass/scss
- redux-saga (optional)
- WDS/HMR/react-hot-loader
- Docker
- Node.js: v8.9.4+
- Yarn: v1.3.0+
- Docker: v1.12.3+
- Install
build-essential
andgit
packages:
sudo apt-get install -y build-essential git
- Install Node.js 8.9.4+:
curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash -
sudo apt-get install -y nodejs
- Install Yarn 1.3.0+:
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update
sudo apt-get install yarn
- Install Docker to production host if it doesn't exist, e.g. via
https://get.docker.com
:
curl -fsSL get.docker.com | sudo sh -
or analogue from Rancher with specifying the certain version:
curl https://releases.rancher.com/install-docker/17.03.sh | sh
- Clone git repo:
git clone git@github.com:izonder/lollipops.git ./lollipops
cd ./lollipops
Tip! In old versions of WebStorm mark /src
directory as resource root for better resolving.
- Install dependencies and run watcher
yarn start
# or with redux-dev-tool
yarn start:dev
The application will be exposed at 9000
port, just open in browser URL http://localhost:9000
Note! Make sure the port is free and the compilation is finished
- Build package (IMPORTANT! make sure you've changed package tag namespace
change-your-namespace/
to your own in the command, read more: https://github.com/izonder/dimbu/blob/master/README.md)
yarn docker
Note! This creates a Docker image lollipops
. To build project without packing to Docker image use command yarn build
.
-
Upload Docker image
lollipops
to production (e.g. via Docker registry) -
Run Docker container:
sudo docker run -d --restart=unless-stopped -p 80:80 lollipops sh
Note! Make sure port 80
is free