This is repository for TaiCOL web.
- copy
dotenv.example
file and rename it to.env
- build react frontend
npm install webpack
npm run build
Note will generate
bundle.js
in./static/react_component/
- start django & react frontend service
docker-compose build
docker-compose up -d
- run
cd /path/to/taicol-web-2022/react-backend/app/
- copy
dotenv.example
file and rename it to.env
- build react backend
npm install
npm run build
Note will generate
.next
folder
- start react backend service
cd /path/to/taicol-web-2022/react-backend
docker-compose up -d
Note when rebuilding react-backend docker container, remember to backup mysql data first
- create symbolic link
ln -t /path/to/tc-web-volumes/static -s /path/to/taicol-web-2022/react-backend/app/public/upload
- grant folder access permission to your user
sudo chown [your_user] /path/to/taicol-web-2022/react-backend/app/public/upload
Note remember to unlink symbolic link
docker-compose down
cd /path/to/taicol-web-2022/react-backend
docker-compose down
cd /path/to/tc-web-volumes/static
unlink upload
Use Amazon linux 2 as example
- install and start nginx
sudo amazon-linux-extras install nginx1
sudo systemctl start nginx
- copy
reverse_proxy-prod.conf
to/etc/nginx/conf.d/
- grant folder access permission to nignx
sudo usermod -a -G [your_user] nginx
chmod 710 /home/[your_user]
- restart nginx to make changes take effect
sudo systemctl restart nginx
- set https with certbot
sudo amazon-linux-extras install epel
sudo yum install certbot-nginx
sudo certbot --nginx