I'm wondering what the best practice is for running Strapi in production. I noticed that Strapi generates new files when a content type is added. This means that the production environment's files will become out of sync with version control. Is there a recommended deployment process? Am I supposed to commit changes from production to my git repo after making changes in the admin?
-
1https://github.com/strapi/strapi/issues/1986 – cnotethegr8 Nov 21 '18 at 13:47
2 Answers
The file generation which is made primarily by content-type-builder
and other settings are disabled in production mode NODE_ENV=production
The admin panel is supposed to be already built on prod, so you only add necessary data into DB based on the given data structure.
TLTR:
Summarizing answer to your question in from github.com/strapi/strapi/issues/1986:
emadicio commented on 20 Sep 2018
If you run your app with NODE_ENV=production you'll notice that plugins that actually edit or create files are disabled. So that means you cannot create or edit content types in prod
Downloaddave commented on 22 Sep 2018:
I had deployed Strapi locally then to a Prod environment, and was confused since I didn't see the content-type-builder in the production CMS.
I'm trying to understand the deployment and update process as well...
- Developer sets Strapi up locally
- Creates content-types using the content-type-builder
- Strapi makes updates to the file structure locally and on the local MongoDB
- On production we will have to push both the code and db updates?
I understand that making changes to the content-type-builder reboots the service, and we don't want production to go down during the rebuild, but it seems like data would get really out of sync between production and development.
Aurelsicoko commented on 2 Oct 2018
You're right! The Content-Type Builder is a development plugin. His goal is to speed up the development of your project. It should not be used in production. We didn't design this plugin like for this usage.
The real pain is to migrate the development configuration to production, and vice-versa. We plan to offer a new command with the CLI called strapi migrate
to easily migrate from an environment to another. I can't give you a release date though...

- 19,913
- 5
- 26
- 32
Any news on this strapi migrate
command? It is a major thing for me and my team in order to do go on with Continuous Integration and delivery.
I hope it is not going to be same like with Wordpress that still has no native solution to solve the migrations between Prod and Stage...
Appreciate the answer. Greetings

- 371
- 3
- 4