strapi / strapi-docker

Install and run your first Strapi project using Docker
https://strapi.io
MIT License
1.16k stars 447 forks source link

Dashborad still shows older Strapi version after upgrade #260

Closed sebqq closed 3 years ago

sebqq commented 3 years ago

So I've just upgraded my strapi application inside of docker container and my console shows right version number:

Screenshot 2020-11-16 at 09 08 34

But the problem is that admin dashboard still shows older strapi version:

Screenshot 2020-11-16 at 09 08 45

During update I followed steps from migration guide and used npm run build -- --clean command to rebuild admin panel. My Dockerfile looks like:

Screenshot 2020-11-16 at 09 10 51

Also my console during build process displayed following message so I think that --clean build was succesfully completed:

Screenshot 2020-11-16 at 09 12 04

Does anyone know what could cause the problem?

Thanks!

alexandrebodin commented 3 years ago

Hi,

Can you verify your package.json or pacakge-lock.json is not pointing to an older version of the strapi-admin package ?

sebqq commented 3 years ago
Screenshot 2020-11-16 at 15 03 03 Screenshot 2020-11-16 at 15 02 56

It looks like it is pointing to 3.3.2. I've also tried to remove package-lock.json and node_modules.

alexandrebodin commented 3 years ago

Hey, I don't see anything wrong and I can't reproduce... are you using a volum with docker-compose or just docker run this image ?

sebqq commented 3 years ago

I'm using combination of following two docker-compose files:

version: "3"
# docker-compose.yml

services:
  backend:
    container_name: container-strapi
    restart: unless-stopped
    networks:
      - strapi-app-network
    volumes:
      - .:/usr/app
      - /usr/app/node_modules
    depends_on:
      - db
    ports:
      - 1337:1337
    expose:
      - 1337

  db:
    image: mongo
    container_name: container-mongo
    networks:
      - strapi-app-network
    ports:
      - 27017:27017

networks:
  strapi-app-network:
    driver: bridge

and

version: "3"
# docker-compose.dev.yml

services:
  backend:
    build:
      context: .
      dockerfile: Dockerfile
    environment:
      NODE_ENV: development
      DATABASE_CLIENT: mongo
      DATABASE_NAME: strapi
      DATABASE_HOST: db
      DATABASE_PORT: 27017
      DATABASE_USERNAME: test
      DATABASE_PASSWORD: test

  db:
    environment:
      MONGO_INITDB_DATABASE: strapi
      MONGO_INITDB_ROOT_USERNAME: test
      MONGO_INITDB_ROOT_PASSWORD: test
    volumes:
      - ./.test-db:/data/db

Can there be any problem with node_modules volume?

sebqq commented 3 years ago

Also, this picture is interesting

Screenshot 2020-11-17 at 11 09 56
alexandrebodin commented 3 years ago

Hi, your 1st config will not use the image files but mount them so you will need to run a yarn build on the host. In your second conf it seems to me that it should work fine if you built the image previously :/

The screen shows that the api is in 3.3.3 and the admin in 3.3.2 and you upgraded the front from 3.2.2 to 3.3.2 by the way so you must have fixed something at some point :)

sebqq commented 3 years ago

@alexandrebodin I'm actually merging these two files using docker-compose -f docker-compose.yml -f docker-compose.dev.yml up command. Shouldn't it combine these two yml configs into one?

The screen shows that the api is in 3.3.3 and the admin in 3.3.2 and you upgraded the front from 3.2.2 to 3.3.2 by the way so you must have fixed something at some point :)

Yep, I've moved from my local machine to VPS and there was another strapi release in the meantime 😄

alexandrebodin commented 3 years ago

I actually never used two docker compose config together :) Good to know !

So if it is actually used as one config then the volume mount overrides the build in the docker image and you still need to build the admin. I would suggest not to mount a volume if you already copy the files in the image.

sebqq commented 3 years ago

@alexandrebodin That seems to work 😺 thank you so much!