How to run latest Strapi with docker?

Hi,

I am on a apple m1 laptop, and running node v18.15.0.

After creating a empty strapi project with the command

npx create-strapi-app@latest myproject --quickstart

I check that the version of strapi in the package.json file is 4.9.1

I then ran the command

npx @strapi-community/dockerize

I went through the interactive setup, using the following setup:
:popcorn: JavaScript project detected

:package: YARN detected

:heavy_check_mark: Do you want to create a docker-compose file? :whale: · No / Yes
:heavy_check_mark: What enviroments do you want to configure? · Both
:heavy_check_mark: What database do you want to use? · PostgreSQL
:heavy_check_mark: Database Host · localhost
:heavy_check_mark: Database Name · strapi
:heavy_check_mark: Database Username · strapi
:heavy_check_mark: Database Password · ******
:heavy_check_mark: Database Port · 5432
:whale: Added docker-compose file with POSTGRESQL configuration

:whale: Dockerfile for PRODUCTION added

:male_detective: Added Dockerize variables in .env file

:floppy_disk: Added POSTGRESQL configuration to database.js

:package: No old dependencies to clean up

:package: PostgreSQL dependencies installed with YARN

:point_up: Strapi is now dockerized :whale: - have a look at the logs above for more info. :rocket:

:star: Star the project on GitHub if you liked this tool :pray:.

:point_right: GitHub - strapi-community/strapi-tool-dockerize: Easy add support for docker to your strapi project :point_left:

password was set to strapi too… this is just a testbed so I don’t mind showing the credentials.

I got one error running the command

docker-compose up -d

I got one error regarding the platform, but I changed the strapiDB services to postgres:12.0

Then it created the container, but when logging into the admin panel I see that I am running strapi v4.9.0.
In Docker desktop, I go into files and check the content of package.json in the opt/app folder and see that strapi is set to v4.9.0 instead of v4.9.1 in the local root package.json file. Why is this?

The second issue is after shutting the container, I try to run the local instance with yarn develop, this gives me the following error:
[2023-04-15 19:10:11.705] debug: :no_entry: Server wasn’t able to start properly.
[2023-04-15 19:10:11.706] error: role “strapi” does not exist

On a positive note, the tool does create a docker container in an effortless manner, but could you explain why I am getting the strange behavior? This is repeated regardless if creating a completely new strapi instance or running the tool on a previous strapi project.

Really grateful for all the hard work you have put into this

brgds
Sohail