Giter Club home page Giter Club logo

Comments (8)

rolandgeider avatar rolandgeider commented on August 13, 2024 1

I've commited a fix in master, but want to test whether the autoincrement ID needs to be reset on the database since it was being set manually in the download script (also, running the script will not work till the website is updated)

from docker.

rolandgeider avatar rolandgeider commented on August 13, 2024 1

Great! Closing here, if you encounter the problem again, just re-open

from docker.

rolandgeider avatar rolandgeider commented on August 13, 2024

That's interesting (and obviously a bug). It's also interesting that it clashes with an id when it should add a new one. Does the docker imagine have already exercise images?

from docker.

ameisehaufen avatar ameisehaufen commented on August 13, 2024

The docker image hasn't images, but, after using docker compose, I generate the images using the command

docker-compose exec web python3 manage.py download-exercise-images

docker-compose exec web wger load-online-fixtures

Without any error message.

I even tried to exec docker-compose exec web python3 manage.py migrate, but it didn't solved the issue.

I used the docker-compose up -d, in a fresh install, using the following docker-compose.yml and prod.env below.
I just changed the port (from 80 to 58148), and volumes, but I think the problem is not related to that.

docker-compose.yml

version: '3.7'

services:
  web:
    image: wger/devel:latest
    volumes:
      - /home/username/wger/static:/home/wger/static
      - /home/username/wger/media:/home/wger/media
    ports:
      - 8000
    env_file:
      - ./prod.env
    depends_on:
      - db
      - cache

  nginx:
    build: ./nginx
    volumes:
      - /home/username/wger/static:/wger/static:ro
      - /home/username/wger/media:/wger/media:ro
    ports:
      - 58148:80
    depends_on:
      - web

  db:
    image: postgres:12.0-alpine
    volumes:
      - /home/username/wger/postgres-data:/var/lib/postgresql/data/
    expose:
      - 5432
    environment:
      - POSTGRES_USER=wger
      - POSTGRES_PASSWORD=wger
      - POSTGRES_DB=wger

  cache:
    restart: always
    image: redis:latest
    expose:
      - 6379

volumes:
  postgres-data:
  static:
  media:

prod.env

# Database
DJANGO_DB_ENGINE=django.db.backends.postgresql
DJANGO_DB_DATABASE=wger
DJANGO_DB_USER=wger
DJANGO_DB_PASSWORD=wger
DJANGO_DB_HOST=db
DJANGO_DB_PORT=5432

# Cache
DJANGO_CACHE_BACKEND=django_redis.cache.RedisCache
DJANGO_CACHE_LOCATION=redis://cache:6379/1
DJANGO_CACHE_TIMEOUT= 1296000
# 60*60*24*15, 15 Days
DJANGO_CACHE_CLIENT_CLASS=django_redis.client.DefaultClient

DJANGO_MEDIA_ROOT=/home/wger/media

# Change the secret key to a random string if you are running this instance publicly
SECRET_KEY=mysecretkey


# Application
ALLOW_REGISTRATION=True
ALLOW_GUEST_USERS=False

# Others
DJANGO_DEBUG=False
WGER_USE_GUNICORN=True
TIME_ZONE=Europe/Berlin
SITE_URL=http://localhost:8000

from docker.

rolandgeider avatar rolandgeider commented on August 13, 2024

Found the error, the exercise images were being identified by their ID, so if there were locally uploaded images they would clash when (or after) running download-exercise-images. I'll add a UUID as we do with the exercises so it's possible to properly reference them

from docker.

ameisehaufen avatar ameisehaufen commented on August 13, 2024

Ok, I will wait for the tests. Thank you! Really nice software.

from docker.

rolandgeider avatar rolandgeider commented on August 13, 2024

you might have to change the postgres sequence for the image IDs. For that, you will need to exec into the DB container and do something like this:

ALTER SEQUENCE exercises_exerciseimage_id_seq RESTART WITH 500;

I'm also not sure whether you need to to reload the exercise and exercise base fixtures, probably not. So, depending on how much data you have entered, it might be faster to drop the DB and pull a new version
(while I was looking into this, I refactored the image script, it should be way faster now)

from docker.

ameisehaufen avatar ameisehaufen commented on August 13, 2024

Thanks! I was just starting to add pictures, so I will drop the DP and pull the new version.

from docker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.