mediacms-io / mediacms

MediaCMS is a modern, fully featured open source video and media CMS, written in Python/Django and React, featuring a REST API.
https://mediacms.io
GNU Affero General Public License v3.0
2.52k stars 459 forks source link

Borked admininstration page in fresh Docker install #902

Closed vylion closed 7 months ago

vylion commented 8 months ago

Describe the issue A clear and concise description of what the issue is.

To Reproduce Steps to reproduce the issue:

  1. Deploy a new docker instance
  2. Log in as an admin
  3. Go to the MediaCMS administration page

Expected behavior Getting a usable page.

Screenshots I honestly can't tell how is the admin panel is supposed to be used just from the looks of it:

django administration

Environment (please complete the following information):

Additional context Checking into the logs, it's complaining about a bunch of js and css files in subfolders under the path /home/mediacms.io/mediacms/static/admin/. Getting into the docker and checking /home/mediacms.io/mediacms/static shows css favicons images js lib subfolders but, of course, no admin subfolder. Did I miss something in the configuration?

Here's my Docker compose file:

version: "3"

services:
  migrations:
    image: mediacms/mediacms:latest
    volumes:
      - /data/mediacms/local_settings.py:/home/mediacms.io/mediacms/deploy/docker/local_settings.py
    environment:
      ENABLE_UWSGI: 'no'
      ENABLE_NGINX: 'no'
      ENABLE_CELERY_SHORT: 'no'
      ENABLE_CELERY_LONG: 'no'
      ENABLE_CELERY_BEAT: 'no'
      ADMIN_USER: *****
      ADMIN_EMAIL: *****
      ADMIN_PASSWORD: *****
    command: "./deploy/docker/prestart.sh"
    restart: on-failure
    depends_on:
      redis:
        condition: service_healthy
      db:
        condition: service_healthy
  web:
    image: mediacms/mediacms:latest
    deploy:
      replicas: 1
    ports:
      - "80:80"
    volumes:
      - /storage/mediacms:/home/mediacms.io/mediacms/media_files/
      - /data/mediacms/local_settings.py:/home/mediacms.io/mediacms/deploy/docker/local_settings.py
    environment:
      ENABLE_CELERY_BEAT: 'no'
      ENABLE_CELERY_SHORT: 'no'
      ENABLE_CELERY_LONG: 'no'
      ENABLE_MIGRATIONS: 'no'
    depends_on:
      - migrations
  celery_beat:
    image: mediacms/mediacms:latest
    volumes:
      - /data/mediacms/local_settings.py:/home/mediacms.io/mediacms/deploy/docker/local_settings.py
    environment:
      ENABLE_UWSGI: 'no'
      ENABLE_NGINX: 'no'
      ENABLE_CELERY_SHORT: 'no'
      ENABLE_CELERY_LONG: 'no'
      ENABLE_MIGRATIONS: 'no'
    depends_on:
      - redis
  celery_worker:
    image: mediacms/mediacms:latest
    deploy:
      replicas: 1
    volumes:
      - /storage/mediacms:/home/mediacms.io/mediacms/media_files/
      - /data/mediacms/local_settings.py:/home/mediacms.io/mediacms/deploy/docker/local_settings.py
    environment:
      ENABLE_UWSGI: 'no'
      ENABLE_NGINX: 'no'
      ENABLE_CELERY_BEAT: 'no'
      ENABLE_MIGRATIONS: 'no'
    depends_on:
      - migrations
  db:
    image: postgres:15.2-alpine
    volumes:
      - /data/mediacms/db:/var/lib/postgresql/data/
    restart: always
    environment:
      POSTGRES_USER: *****
      POSTGRES_PASSWORD: *****
      POSTGRES_DB: *****
      TZ: Europe/Madrid
    healthcheck:
      test: ["CMD-SHELL", "pg_isready", "--host=db", "--dbname=$POSTGRES_DB", "--username=$POSTGRES_USER"]
      interval: 30s
      timeout: 10s
      retries: 5
  redis:
    image: "redis:alpine"
    restart: always
    healthcheck:
      test: ["CMD", "redis-cli","ping"]
      interval: 30s
      timeout: 10s
      retries: 3

Also, in case there's reasonable doubt, the Postgres variables match with what's on local_settings.py, I triple-checked.

Adito5393 commented 8 months ago

@vylion Have you see #470?

vylion commented 8 months ago

Oh! I looked for similar issues to mine but didn't find that one. Thank you, I can fix it with that; I'd still like to figure out what I did wrong, though, as this is a clean install. Did I bind a volume to a local folder that I shouldn't have bound?

Adito5393 commented 7 months ago

Nothing wrong with your installation. I had the same issue & fixed it using the same command. I guess, the issue does not appear if you actually git clone the whole repo and bind the current directory:

volumes:
      - ./:/home/mediacms.io/mediacms/

Which defeats the purpose of using docker in the first place! As you can see in #709, docker support is needed. Feel free to contribute. (and close this issue if you fixed it)