Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regarding deployment in server #1913

Open
rexin1995 opened this issue Apr 15, 2023 · 5 comments
Open

Regarding deployment in server #1913

rexin1995 opened this issue Apr 15, 2023 · 5 comments

Comments

@rexin1995
Copy link

📖 Documentation

I dont know how to host and run razzle app in xampp or apche servers kindly help me out how to deploy this

@fivethreeo
Copy link
Collaborator

In summary, to run a Razzle app with Apache using a reverse proxy, you need to:

Install the mod_proxy module for Apache.
Build your Razzle app and copy the build folder to your Apache server.
Create an Apache virtual host configuration file for your Razzle app.
Enable the virtual host and restart Apache.

To run a Node.js app with pm2 using systemd, you need to:

Install pm2 globally.
Start your app using pm2.
Save the pm2 process list.
Create a systemd service file for your app.
Reload the systemd daemon.
Enable and start the systemd service.

These steps will ensure that your Razzle app is served correctly through Apache and that your Node.js app is running as a systemd service.

@fivethreeo
Copy link
Collaborator

<VirtualHost *:80>
  ServerName example.com
  ServerAlias www.example.com

  # Serve the public directory of the Razzle app
  Alias "/public" "/var/www/my-razzle-app/build/public"
  <Directory "/var/www/my-razzle-app/build/public">
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted
  </Directory>

  # Proxy requests to Razzle app running on port 3000
  ProxyPreserveHost On
  ProxyPass / http://localhost:3000/
  ProxyPassReverse / http://localhost:3000/
</VirtualHost>

[Unit]
Description=My Razzle App
After=network.target

[Service]
Type=simple
User=<user>
ExecStart=/usr/bin/pm2 start /path/to/razzle/app/pm2.config.js --env production
ExecReload=/usr/bin/pm2 reload /path/to/razzle/app/pm2.config.js --env production
ExecStop=/usr/bin/pm2 stop /path/to/razzle/app/pm2.config.js --env production
WorkingDirectory=/path/to/razzle/app
Restart=on-failure
RestartSec=10s

[Install]
WantedBy=multi-user.target

@fivethreeo
Copy link
Collaborator

Answer by chatgpt :)

@debchy
Copy link

debchy commented Jan 11, 2024

How to make the razzle build with CICD pipeline?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants