I've modified a Tailwind 'Template' site. The README instructions are good for running it locally but don't mention anything about deploying it in a Production environment. I'm looking for step by step instructions on how to deploy it. I've tried to deploy on a shared hosting site but given up and now on netlify but still not having any joy.
Locally the app builds almost immediately. In netlify the build takes an age. Log:
12:09:35 PM: $ npm run dev
12:09:36 PM: > [email protected] dev
12:09:36 PM: > next dev
12:09:36 PM: - info Loaded env from /opt/build/repo/spotlight-ts/.env.local
12:09:36 PM: - ready started server on [::]:3000, url: http://localhost:3000
12:09:37 PM: - info automatically enabled Fast Refresh for 1 custom loader
12:09:37 PM: - event compiled client and server successfully in 224 ms (20 modules)
12:09:38 PM: - wait compiling...
12:09:38 PM: - event compiled client and server successfully in 116 ms (20 modules)
12:09:38 PM: - info Loaded env from /opt/build/repo/spotlight-ts/.env.local
12:09:38 PM: - info Loaded env from /opt/build/repo/spotlight-ts/.env.local
12:27:43 PM: Execution timed out after 18m10.00140564s
12:27:43 PM: Error running command: Command did not finish within the time limit
12:27:43 PM: Failing build: Failed to build site
12:27:43 PM: Finished processing build request in 18m27.841s
12:27:43 PM: Failed during stage "building site": Command did not finish within the time limit
===========================================
Tailwinds README:
## Getting started
To get started with this template, first install the npm dependencies:
```bash
npm install
```
Next, create a `.env.local` file in the root of your project and set the `NEXT_PUBLIC_SITE_URL` variable to your site's public URL:
```
NEXT_PUBLIC_SITE_URL=https://example.com
```
Next, run the development server:
```bash
npm run dev
```
Finally, open [http://localhost:3000](http://localhost:3000) in your browser to view the website.
The deploy process is different in VPS and Host. If you use Host, please contact the support section. But if you want to deploy on VPS, I will tell you how to do it step by step. Please change the
theNewUser
,yourDomainName.com
,theStrongPassword
and .... with your vars.Please pay attention that some libs like Prisma NOT work on CentOS, so you have to choose Ubuntu 18 or later version. And you can pass some steps if you don't want it.
Connenting to server with ssh in terminal:
Update the server:
Configure SSH:
Change the #Port 22 to other thing
Change password of ssh:
Enter code and type new password in terminal for root user
Restart the ssh:
Connect the server with new pass!
Allow new port on ufw:
Installing necessary deps:
node:
npm:
pm2:
Mysql + phpMyAdmin:
Installing
Configurations
Apache2
Add this to last line and save it:
Include /etc/phpmyadmin/apache.conf
Mysql
In mysql:
Run this to secure mysql
mysql_secure_installation
Create shortcut phpmyadmin folder to nginx folder
phpmyadmin security options
Edit config file to secure phpMyAdmin
This should be set to a random string of at least 32 chars
nano /etc/phpmyadmin/conf.d/pma_secure.php
(Optional security function)
For new other server creating authentication gateway in terminal enter and confirm the 8 char pass to get codded pass
openssl passwd
Enter the username and codded pass
nano /etc/nginx/pma_pass
newUser:strongPass
Nginx:
First we remove apache2
Installing nginx
Make main domain
Installing ssl
nano /etc/ssl/cert.pem
Paste ssl certification >>IN ORIGIN SECTION<<nano /etc/ssl/key.pem
Paste ssl key >>IN ORIGIN SECTION<<Edit nginx main server
nano /etc/nginx/sites-available/yourDomain.com
Unlink and reload server
Git
Get repository from Git
git clone yourRepoAddress
Deploy and save in pm2
Go to your repo folder and do these steps: First you have to delete
packaje-lock.json
file. We usepm2
because if we close the ssh, app will run automatically