So far I have set up a mySQL server on Amazon lightsail and have succesfully used it while running strapi locally. How do I deploy Strapi itself on lightsail and get a link to access it through a browser?
I have read through https://strapi.io/documentation/3.0.0-beta.x/deployment/amazon-aws.html, but the guide is for AWS EC2. Do the same steps apply to lightsail?
So I ended up figuring out. Please let me know if something is wrong or can be done better:
Start an Ubuntu instance in lightsail, I picked the 2GB RAM tier because that's the min requirements for Strapi to run (they have them listed in their documents) and give it a static IP address.
Install node onto your server:
cd ~
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
...
sudo apt-get install nodejs
...
node -v && npm -v
I cloned my project from github, so a lot of node modules weren't imported due to .gitignore. Simply cd into the project direcotry and run node install to install all the missing dependencies.
run npm build to build the panel, then npm start
it should tell you to go to localhost:1337, instead go to [your server's IP address]:1337
your Strapi app should be on the screen
Yes, The strapi can be deployed to Lightsail. But there will be no advantages.
Lightsail must be configured as a Node.js server.
Deploy from github
Install PM2 Runtime
Related
https://laravel.com/docs/9.x/sail
I did a clean Laravel install with Sail on computer 1. It is all setup and working with all containers running (mysql, laravel, redis, etc) and Docker Desktop is showing that it is connected to Windows WSL2 and running in that environment. I never had to install PHP as this install procedure took care of the entire environment.
However, I would now like to pull this repo down on Computer 2 and run it in containers as well. So I pulled down the repo, it didn't have a devcontainers folder, only docker-compose.
I tried running docker compose up and the error is the vendor folder is empty/non existent for obvious reasons.
Now, I could install PHP with the right version and then install composer install and then try again. But that doesn't seem right to me.
Shouldn't I be able to just run this repo as a remote container in Vscode and have it running everything on its own?
How do I get the vendor/bin/sail folders installed?
I went back to computer 1 and created a devcontainer folder using remote-containers, pulled that down onto computer 2 but computer is still does not have the right vendor folder and files to complete the operations.
What am I doing wrong?
Assuming you have Docker working correctly at the second computer, you could run a temporary sail container just to install the composer dependencies in said project, as explained in the Laravel Sail documentation
docker run --rm \
-u "$(id -u):$(id -g)" \
-v $(pwd):/var/www/html \
-w /var/www/html \
laravelsail/php81-composer:latest \
composer install --ignore-platform-reqs
https://laravel.com/docs/9.x/sail#installing-composer-dependencies-for-existing-projects
After this the temporary container will not exist anymore and you can now run ./vendor/bin/sail up -d normally.
Currently I am using pm2 and nodejs on windows to deploy nuxt.js project. Below are my steps:
Build project with npm run build
Copy 【.nuxt, static, nuxt.config.js, package.json】 to a new folder call prod01
In prod01 folder, execute npm i to install dependencies and use npm run start to check if everything works fine.
Then, I config nginx, install pm2 and use pm2 start node_modules/nuxt/bin/nuxt.js --name prod01 to start my project. (I've tried a lot of pm2 commands and this works for me)
However, after I use above pm2 start command, the dist folder in .nuxt has been deleted, and all I can see on
because dist in .nuxt was not existed.
Does anyone have any ideas about how this happened? My nuxt.config setting like meta description is still there, and I can open the web pages.
Or is there any solutions except using docker, that can also do server side rendering? Or maybe I should try using docker?
Please help me, thank you!
I'm working on a Drupal 8 site which is deployed on Heroku, how would I run Drush or Drupal commands on here? When I try it with the built in command line on the Heroku site it complains about MySQL not being present. Is it possible to run Drush or Drupal commands on Heroku? Could I run the commands locally but somehow connect to the Heroku boxes?
I got in touch with Heroku support and managed to resolve the problem, in order to install MySQL you have to use their buildpacks.
If you go to your App > Settings > Buildpacks section you can add https://buildpack-registry.s3.amazonaws.com/buildpacks/heroku-community/apt.tgz which from what I understand allows you to install packages using an Aptfile in your repository.
Once that Buildpack has been added in the root of your code that's deployed to Heroku add a file named "Aptfile", no extension and add the following two lines to it:
mysql-common
mysql-client
I'm not sure if mysql-common is needed but mysql-client certainly is. Deploy this to your Heroku environment and you should be able to run Drush commands now, be sure to add that Buildpack before adding the Aptfile as adding the Buildpack only adds it on the next environment build which happens with a new commit.
Running Drush is pretty easy ones you've done this. To do it via the web interface click the "More" button near the top right of the screen when you're looking at your app in Heroku and select "Open Console" then enter bash in the new panel and click "Run". Now you should be able to run Drush commands from here.
If you want to run the from your local terminal use https://devcenter.heroku.com/articles/one-off-dynos#an-example-one-off-dyno in the Heroku CLI (which you'll have to install). You may have to use the --dyno or --app flags to run Drush in the correct place.
I am about to finally deploy my laravel app to shared host soon, using ssh. My question here is: in local enviroment I installed all npm dependencies (npm install), to compile all vue.js scripts.
What i already know is that: after uploading everything to shared host I should run "composer install" to install composer dependencies and edit .env.
But should I also run "npm install" if I already have my app.js compiled on local enviroment?
Thanks,
PS
You actually probably don't have npm on a shared server. At least with HostGator, which is where I have experience, it wasn't possible - in which case - you would need to run and compile npm locally before pushing to the server.
Yes as per my experience with Hostinger it is not possible to install NODE, and NPM via a command on the server. Because it is not a private server and it is already given us our requirements setup during server selection. So you can do this by pushing your js assets with git and pulling on the server to get js.
How to Start Playground in the developer environment? Please provide the document.
I am following the developer installation guide: https://hyperledger.github.io/composer/tutorials/developer-guide.html
If you want to run the Playground locally, install the composer-playground using the following command.
npm install -g composer-playground
I don't see how to start the playground after that.
Thank you, Christo. I am able to install now. I installed playground first and installed all other composer components(npm install -g composer-cli,npm install -g generator-hyper ledger-composer,npm install -g composer-rest-server). Problem is now, I am not able to deploy .bna using admin credentials for composer-rest-server. Next tried deploying using the PeerAdmin for composer-rest-server, which was successful.
Now the issue is not allowing the asset creation (Throwing, the asset cannot be created via PeerAdmin). What is the proper way to set up the developer environment plus playground in the same environment?
The instructions are in the tutorial documentation. Basically, you need to install and start the Hyperledger Fabric network, configured for Composer. It will launch the playground in your favorite browser.
After the first time you run it, you can start/stop the network with composer.sh to re-start, and composer.sh stop (from the directory into which you installed fabric-tools) to shutdown all the Fabric and Composer docker images. Once started, you can open http://localhost:8080/login to start the playground.