we are trying to deploy laravel app(which contains api's) and vue js app(contains full front end).both are in seperate folders how to deploy through bitbucket pipeline.
The best work around is for you to have a laravel image and docker image separately. You can then push the images to docker hub and create containers on the server using the latest images. You can also consider using watchtower to help in updating you containers everytime we have a new images available in dockerhub.
Related
I have a Laravel project that already deployed on shared hosting server but now I just want to add Vue.js component to that project.
Problem is when I was deploying project I didn't install the npm. Can anyone advise me how to fix this thing. I used Laravel 5.8
How can I add Vue component to this project ?
you can't run npm commands in sharing hosting .
you can run npm run production in local and share mixed file on sharing hosting
Usually shared hosting does not provide enough shell commands. So you would need to run npm run production on your local computer.
As a reminder, it is not recommedable to host Laravel website on a shared host. You may need to do extra work to make your Laravel website work such as changing document root of your laravel project.
I've linked Postgres DB & API images using docker-compose, its working in local, I've to push both image for gitlab registry Using CI/CD.
enter image description here
The gitlab docs cover how to build and push Docker images during CI quite well.
It is important to note/use the CI_REGISTRY_IMAGE variable. If the image name you try to push is different from CI_REGISTRY_IMAGE, the push will fail. If you want to have multiple images, you either need to label them in the tag ($CI_REGISTRY_IMAGE:db-$CI_COMMIT_REF_SLUG) or create a separate repo and manage the images there.
I have 2 repositories residing in Bitbucket - Backend (Laravel app as the API and entry point) and Frontend (Main application front-end - VueJs app). My goal is to set up continuous deployment so whenever something is pushed in either of the repos in master (or other branch selected by me) branch it triggers something so that the whole app builds and reaches the AWS EC2 server.
I have considered/tried the following:
AWS CodePipeline and/or CodeDeploy. This looked like a great option
since the servers are in AWS as well. However, there is no support
for Bitbucket out of the box, so it would have to go to Bitbucket
Pipeline -> AWS Lambda -> AWS S3 -> AWS CodePipeline/CodeDeploy ->
AWS EC2. This seems like a very lengthy journey and I am not sure if
that's a good practice whatsoever.
Using Laravel Forge to deploy the Laravel app, and add additional steps to build the VueJS app. This seemed like a very basic solution,
however, the build process seems to fail there as it just takes long
time and crashes with no errors (whereas I can run exact same process
on my local machine or a different server hosted elsewhere). I am not
sure if this is issue with the way server is provisioned, the way
Forge runs deployment script or the server is too weak to handle it.
The main question of mine would be what are the best pracises for deploying the app of such components? I have read many tutorials/articles about deploying a NodeJS app, or a Laravel app, but haven't gotten good information about a scenario like this.
Would it be better to build the front-end app locally and version control the built JS file? Or should I create a Pipeline in Bitbucket that would build the app and then deploy it? Or is it the best to just version control and deploy the source files and leave the whole build process as the last step in the deployment process that will be done by the server that is hosting the app itself? There are also some articles suggesting hosting the whole front-end app in S3 bucket - would that be bad practise as well?
Appreciate any help and resources that would help!
From the sounds of things it sounds like you have two types of deployments you might want to run.
Laravel API: If you're using Laravel Forge already then this is a great way to go about deploying your Laravel App, takes care of most of the process and easy server management.
Vue.js App: Few things you can do here, I personally prefer using a provider like Vercel or Netlify who let you deploy your static sites/frontends for free-low costs. You can write custom build steps but they have great presets that should work out the box.
If you really want to keep everything on AWS then look into how to host static sites on AWS
I am trying to figure out the importance of custom images. Do you have to create and use custom images for your environment, or you can get all the images you need from Docker official images?
Thanks,
At the moment I am using both - a custom image made by me and a ready image from the docker hub. I am using the custom image for my web application and for the database I can easily use an image of postgresql or mysql and just link them both using a docker-compose.yml. So to answer your question, you will normally end up using both.
I have a website build using Codeigniter Framework. I already uploaded it in a web server, TurnKey Lamp in Linux using Git Bash.. I can access it already since it is networked.. What I want now is to make it visible on internet.. How can I do that?