werefox-cafe/start.sh
2021-04-18 02:38:19 +00:00

24 lines
604 B
Bash
Executable File

#!/bin/bash
set -xe
MODE=$1
x=$(sudo docker container ls | grep next-js | wc -l)
if [ $x -eq 1 ]; then
sudo docker-compose rm -sf
fi
sudo MODE=$MODE docker-compose build
if [ ! -d "./src/info" ]; then
sudo docker-compose run node npx create-next-app info
sudo docker-compose run node npx tailwindcss init -p
sudo chown -R $USER:$USER ./src
fi
if [ $MODE == "dev" ] || [ $MODE == "build" ] || [ $MODE == "prod" ]; then
sudo MODE=$MODE docker-compose up --build --force-recreate --remove-orphans -d
else
echo "Please use 'dev', 'build', or 'prod' as an argument."
exit 1
fi