Templates
Strapi Serverless
Deploy an Existing Strapi App
7min
when you deploy infrastructure with the strapi serverless template, you have the possibility to create a new strapi application in your git repository or select an existing strapi application if you already have one by using git for your strapi projects, the process of moving content types from one environment to another is much easier and deployments are more predictable deploy strapi on aws now review your database configuration before deploying the strapi template, please make sure that you have a correct database configuration this is important to make it right because the template provides some predefined environment variables in the app runtime that can be used in the strapi project here is an example of a working database configuration config/database js module exports = ({ env }) => { const connections = { sqlite { connection { client 'sqlite', connection { filename env('database filename', ' tmp/data db'), }, usenullasdefault true, } }, mysql { connection { client 'mysql', connection { host env('database host', 'localhost'), port env int('database port', 3306), database env('database name', 'strapi'), user env('database username', 'strapi'), password env('database password', 'strapi') }, debug false, } }, postgres { connection { client 'postgres', connection { host env('database host', 'localhost'), port env int('database port', 3306), database env('database name', 'strapi'), user env('database username', 'strapi'), password env('database password', 'strapi'), ssl { rejectunauthorized false } }, debug false, } } }; return connections\[env('database client')]; }; deploy your app using the strapi serverless template https //app microtica com/templates/new?template=https //raw\ githubusercontent com/microtica/templates/master/strapi serverless/ microtica/template yaml 1\ import git repository as a first step, you need to connect a git account (github, bitbucket, or gitlab) if you already have a git account connected to microtica, you can choose it from the list select the repository with your existing project, click import , and every git push will be deployed automatically in microtica 2\ configure template the second step is to configure the environment variables for this template variables provide a way to customize a template to meet your requirements for example, here is where you configure the scaling parameters for your strapi app you can scale your app vertically and horizontally for vertical scaling, update the cpu and memory configuration in this section for horizontal scaling, update the number of desired replicas in the same section in this section you can also choose the database client sqlite is the default option you can update the configuration later as well 3\ configure environment after configuring the template, you will need to select an environment where the template will reside environments are a great way to separate your development and production applications if you need to create a new environment, you can enter the environment name and description and click the select button you can also choose an existing environment if you have created one previously next, you need to configure the target aws account where your strapi infrastructure will be provisioned here is a quick guide on how to connect your aws account 4\ deploy once your aws account is connected and configured in the environment, click on the deploy button to trigger the deployment it takes up to 10 mins to create a live strapi environment you can follow the pipeline logs inline, and monitor your deployment in real time once the template deployment finishes, you can find the access url in environment > infrastructure > strapi ( strapi is the appname we provided in the template configuration step), under resource outputs , the accessurl parameter copy paste it in the browser to see your strapi demo app