naskio / docker-strapi

Docker image for strapi v4 (latest version)
https://hub.docker.com/r/naskio/strapi
MIT License
142 stars 49 forks source link

How to upgrade the application correctly #9

Open zentavr opened 1 year ago

zentavr commented 1 year ago

Hi,

There are lines at the docker-entrypoint file: https://github.com/naskio/docker-strapi/blob/5b24cf823acd67d96f6a02135d09b1b98937bfbf/images/strapi-alpine/docker-entrypoint.sh#L25-L37

If we upgrade strapio to the newer version, docker-entrypoint sees that the node_modules folder exists and wont install the upgrades if there are any. How to perform here correctly?

naskio commented 1 year ago

Why not just upgrading the docker image ?

zentavr commented 1 year ago

@naskio this is obvious actually. I'm just wondering how to upgrade all those modules (if needed) when I upgrade docker image?

zentavr commented 1 year ago

@naskio I'm currently building the Helm Chart which installs strapi.io (testing that with K8S in AWS EKS). We are going to have shared NFS folder between the pods, that's why I'm asking.

The code of the helm chart (WIP) is here

cplepage commented 1 year ago

Why not just upgrading the docker image ?

If we pull the newer image, but reuse the same volume for /srv/app that contains the .../public/uploads and ../src/api directories which are vitals for data persistence. Then with the line pointed out by @zentavr, even with a pull, the node_modules won't update and neither the strapi version.

Or maybe I am missing something ?

zentavr commented 1 year ago

Right now we are building our own image. We use current image in development mode in order to create the collections (which creates the files in the src/api folder. Then we commit that into git and have ci/cd pipeline on top of that which runs in AWS Codepileline and builds and spins up the image from our personal repository.

probably we changed dockerfile and an entry point for that.