Files @ ddae8d91f682
Branch filter:

Location: symposion_app/docker/deploy_with_sqlite.sh

James Polley
Improved handling of static/build and css generation

When the container is mounted, the local contents of . obscure
/app/symposion_app in the image.

Generally speaking, this is handy for development, as it means that
local changes are detected and used immediately without needing to
restart the container.

However, it breaks in the specific case of the sass->css
generation. Prior to this change, the css is generated only after the
first time a page is hit. The generated file is placed in
static/build; however, due to the obscuration, this generated file
isn't visible to the running process.

The next time the container is built, the pre-existing static/build
directory is copied into the container as it's being built; then,
later, that version is what gets served.

This change adds the needed libraries to pre-generate the css as part
of the image build, and runs compilescss to do this, prior to the
collectstatic step.

It also adds a second collectstatic into the make_dev_container
script, so that the visible static/build directory should ahve the
same contents as the obscured static/build directory. It also expands
the .dockerignore file to make sure these files aren't copied into the
image in future.

I'm not sure if this is the right thing to do, as changes to this
directory will be ignored, which could be confusing. Perhaps never
being able to see these generated files is better?
#!/bin/bash

/usr/local/bin/python /app/symposion_app/manage.py migrate
/usr/local/bin/python /app/symposion_app/manage.py loaddata /app/symposion_app/fixtures/{conference,proposal_base,sites,sitetree}.json
/usr/local/bin/python /app/symposion_app/manage.py create_review_permissions
#/usr/local/bin/python /app/symposion_app/manage.py populate_inventory
if [ $DATABASE_URL == "sqlite:////tmp/symposion.sqlite" ]; then
    /usr/local/bin/python /app/symposion_app/manage.py loaddata /app/symposion_app/fixtures/admin_users.json
fi

exec /usr/local/bin/uwsgi --http-socket 0.0.0.0:8000 --wsgi-file pinaxcon/wsgi.py