Workflow/steps to take local changes to prod (my case a Docker container)

System Information
  • Strapi Version: v3.6.5
  • Operating System: MacOS Catalina
  • Database: MariaDB 10.5.11
  • Node Version: v14.15.5
  • NPM Version: v6.14.13
  • Yarn Version:

Hi,

Thanks to all to build such an awesome community and tools to build our applications. This is the first time I have used Strapi, I have been using it for 1 month and I have loved it. Also, the documentation is helpful.

About my project:
We are using Strapi for content management for a website. We are using MariaDB as the database.

Where all is running:
We are using Docker. We have 1 container for Strapi, another with a MariaDB instance and another one for our website.

Version control system:
We are using Git and GitLab to save our changes.

My workflow:

  1. Use Strapi locally to do changes, connected directly to the only database we have during development.
  2. Build a Docker image and push it to Docker Hub.
  3. Download the Docker image inside of our server and create a container from it, all by command line.

My issues with the workflow described above:

  1. We have to rebuild an image of Strapi and repeat the process.
  2. We loose the files inside of the “/public/uploads” folder because they are not being tracked by git, according to best practices.
  3. When we do a change in a collection, we have the change inside of the “api/*” folder locally, but, the Strapi running inside of the docker container, doesn’t have it, for obvious reasons. Although, we can see the model changes (view) with the new fields, etc… but the project inside the container doesn’t have the updated files.

What I would like to know from now:

  1. What is the process with Strapi to take the local project and send the changes to my container? For now, the database doesn’t need changes because we are using the same, locally and inside of the container.
  2. I saw other topics that talks about using Git to push my local changes, and inside of the container/server, pull the changes and rebuild Strapi. This is the correct/best approach? If this is the correct approach, I’m not sure what to do once I pull the changes. Do just a build clean or just do strapi start.
  3. Surely, we will have another database for production and I would like to know the best steps to take the changes from the development database to the production database. I know that Strapi has commands as part of its CLI (configuration dump, restore, etc…) but I’m not sure how to use it, not even the order of them.

Maybe this topic has been talked a lot of times, but, I couldn’t find a clear steps or guide to do this kind of things. Besides, we are using docker containers for development, which change the flow a bit.

I would like to thank you all for taking the time to read my post, any help would be appreciated.

1 Like

I am also going through the same problem. Did we get any solution to it.

1 Like