<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Brian</title>
    <description>The latest articles on DEV Community by Brian (@brijmcq).</description>
    <link>https://dev.to/brijmcq</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F100844%2Ffaf5ea68-10df-4d3c-9577-76e55c4cbbf1.png</url>
      <title>DEV Community: Brian</title>
      <link>https://dev.to/brijmcq</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/brijmcq"/>
    <language>en</language>
    <item>
      <title>Deploying Strapi using Digital Ocean's App Platform and Managed DB</title>
      <dc:creator>Brian</dc:creator>
      <pubDate>Fri, 27 Nov 2020 14:23:19 +0000</pubDate>
      <link>https://dev.to/brijmcq/deploying-strapi-using-digital-ocean-s-app-platform-and-managed-db-1m4d</link>
      <guid>https://dev.to/brijmcq/deploying-strapi-using-digital-ocean-s-app-platform-and-managed-db-1m4d</guid>
      <description>&lt;p&gt;In this article, I'm going to share how I deployed one of my  apps using Digital Ocean. This should take you around 15-20 minutes.&lt;/p&gt;

&lt;h1&gt;
  
  
  Updating your code for different environments
&lt;/h1&gt;

&lt;p&gt;Most of the time, I only have 3 environments in my application; development, staging and production.&lt;br&gt;
To create these configurations, you need to create these folders:&lt;br&gt;
config &amp;gt; env &amp;gt; {configName }&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lcx6U2Ph--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bbzkzthtfcycs5lmwr6a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lcx6U2Ph--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/bbzkzthtfcycs5lmwr6a.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Take note of your environment variables, we're going to need them later in App Platform.&lt;/p&gt;

&lt;p&gt;You can learn more from the official &lt;a href="https://strapi.io/documentation/v3.x/concepts/configurations.html#environments"&gt;doc&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Setting up Managed DB
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--F_HoVIaK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6xkyxn3eem78qrsi9a4s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--F_HoVIaK--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/6xkyxn3eem78qrsi9a4s.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
Make sure to choose MySQL. For some reasons, I was not able to connect using Postgres.&lt;/p&gt;

&lt;p&gt;For other options, just pick according to your needs.&lt;/p&gt;

&lt;p&gt;After provisioning is done, create a new user which you are going to use later to connect to your app.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--IqbiLUbI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/53ojx06lsw5curkab7hv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--IqbiLUbI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/53ojx06lsw5curkab7hv.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
For Password Encryption, use the &lt;strong&gt;Legacy – MySQL 5.x&lt;/strong&gt;. I'm not a DB expert and it took me a lot of time to figure out this one.&lt;/p&gt;

&lt;p&gt;Take note of the connection details found here&lt;br&gt;
&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--gYDUtgEG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5ff3u74tibj7z4hyrk9m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--gYDUtgEG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/5ff3u74tibj7z4hyrk9m.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
You will need them later when setting up the environment variables.&lt;/p&gt;

&lt;p&gt;DB part is done and now we go to the App Platform&lt;/p&gt;

&lt;h1&gt;
  
  
  Setting up App Platform
&lt;/h1&gt;

&lt;p&gt;App platform will prompt you to choose your git repo and branch to deploy from.&lt;/p&gt;

&lt;p&gt;After clicking Next, you will be prompted similar to this screenshot&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--io32n7jV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/z8cit8m3fewz8mt0px6y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--io32n7jV--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/z8cit8m3fewz8mt0px6y.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
The important part here is the &lt;strong&gt;Environment Variables&lt;/strong&gt;. You can set them now or just do it later. For Build/Run Command, you don't need to change it since the scripts in your package.json already had the same names and working accordingly.&lt;/p&gt;

&lt;p&gt;Set the values of your Environment variables now if you haven't because the build will fail without them.&lt;br&gt;
You can go to the Components tab &amp;gt; Environment variables&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mDwmmRst--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zmg1qf8362lieoheu7m1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mDwmmRst--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zmg1qf8362lieoheu7m1.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
You can freely choose your own variable names and don't need to necessarily copy mine. After clicking save, App Platform will rebuild your app.&lt;/p&gt;

&lt;p&gt;If the build finish successfully, you will see a link in your dashboard like this&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--7FQzhEqo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cyb2eng0a67jg3we6b38.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--7FQzhEqo--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cyb2eng0a67jg3we6b38.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Feedback is welcome. If you have a better way of doing things, please comment it down below.&lt;/p&gt;

&lt;p&gt;If you reached this section, please consider using my affiliate link when creating a new account :D&lt;br&gt;
You will get $100 in credit over 60 days&lt;br&gt;
&lt;a href="https://m.do.co/c/5c95573fc1d2"&gt;https://m.do.co/c/5c95573fc1d2&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
