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:
JavaScript project detected
YARN detected
Do you want to create a docker-compose file?
· No / Yes
What enviroments do you want to configure? · Both
What database do you want to use? · PostgreSQL
Database Host · localhost
Database Name · strapi
Database Username · strapi
Database Password · ******
Database Port · 5432
Added docker-compose file with POSTGRESQL configuration
Dockerfile for PRODUCTION added
Added Dockerize variables in .env file
Added POSTGRESQL configuration to database.js
No old dependencies to clean up
PostgreSQL dependencies installed with YARN
Strapi is now dockerized
- have a look at the logs above for more info. ![]()
Star the project on GitHub if you liked this tool
.
GitHub - strapi-community/strapi-tool-dockerize: Easy add support for docker to your strapi project ![]()
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:
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