How do you properly deploy your strapi?

System Information
  • Strapi Version: 4.20
  • Operating System: ubuntu
  • Database: mysql
  • Node Version: node:18-alpine
  • NPM Version:
  • Yarn Version:

Hey all!

I am working with strapi and gatsby combination since a few month now. But I still have some issues organizing strapi in general.

What I do right now:

  • I push my project to gitlab when doing changes.
    So basically, when I create a new component in strapi, I test it with some content and then push it when I am certain it works.
  • The gitlab CI then triggers a script that basically pulls the latest commit on my server. The script then starts building strapi in a docker. The mysql database is running permanently with the content I have on the remote server of course.

The issues I have:

  • When I create a component locally, then push the project with the new components - which schemas are in json files in strapi - I have sometimes trouble seeing these components on the remote server. It feels like that when creating a component, strapi not only creates json files as schemas but also some database entry which is then missing on the remote server.

I would like to know how you guys solve this issue. Since I kept exporting my local database to import it on the remote server manually, every time I make a new commit, it was working for me. But now we want to go live soon and I am afraid I cant get all the created content deleted with exporting and importing my local database. Makes sense. The database should actually not even be the bottleneck of strapi working properly.

What am I missing here?
I am “still” at 4.20 and afraid of updating since strapi seems to have MANY issues regarding the database. One issue I have rn is that my API completely broke after I created a component locally which I then tested and after that deleted the component.

Now the API is not working anymore because strapi seem to miss this component which I dont have anymore… So basically, there is some trash in the database and I dont have any idea of the database and even where to look for what…

However. Whats your setup? How do you create components locally and push it on your server?

Thanks in advance