Closed kousu closed 7 years ago
@kousu I never looked at collectstatic but I doubt if it still works as we have been using gulp for quite a while. I'll let you know.
Thanks @lingxiaoyang; I think it should be perfectly reproducible if you start from a fresh checkout and run with the production settings
git clone https://github.com/savoirfairelinux/sous-chef/ sous-chef-prodtest
cd sous-chef-prodtest
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up
@kousu yes, we have a bug there! I will look into it.
@kousu this bug has been fixed in PR #775 You could check it from a fresh checkout using this commands:
git clone https://github.com/savoirfairelinux/sous-chef/ sous-chef-prodtest
cd sous-chef-prodtest
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up
docker-compose exec web sh -c "python src/manage.py migrate"
docker-compose exec web sh -c "python src/manage.py createsuperuser"
docker-compose exec web sh -c "python src/manage.py loaddata sample_data"
Then add the hostname "souschef.santropolroulant.org" in your /etc/hosts
127.0.0.1 souschef.santropolroulant.org
And check it out in a browser http://souschef.santropolroulant.org/
Note: The Hostname http://souschef.santropolroulant.org/ could be changed in the docker-compose.prod.yml
I'm closing this issue, you could reopen it if you find any problems.
I just tried putting sous-chef up again using
docker-compose -f docker-compose.yml -f docker-compose.prod.yml up -d
, which runs/bin/bash -c "cd tools/gulp && npm install && gulp && cd ../../src && python manage.py collectstatic --noinput && /usr/local/bin/gunicorn sous_chef.wsgi:application -w 2 -b :8000
. Strangely, this did not create the staticfiles properly; for example http://localhost:8000/static/images/logo-souschef-coul.png was 404'ing.I re-ran
docker-compose exec web "cd tools/gulp && npm install && gulp"
and then it worked.There are three copies of the static files:
I think, but haven't fully tested yet, that
src/frontend
is the source folder,src/static
is made bycollectstatic
, andsrc/sous_chef/static/
is made by gulp and is the one generated by gulp, and furthermore perhapscollectstatic
is erasing it, which meansgulp && cd ../../src && python manage.py collectstatic --noinput
should rather bepython manage.py collectstatic --noinput && cd ../tools/gulp && gulp
or maybe even justgulp
.Does anyone know what's going on here? The behaviour is very inconsistent and confusing.