mirror of
https://github.com/ChristianLight/tutor.git
synced 2025-01-05 15:12:10 +00:00
Simplify migrations and static collection
Migrations and static assets collection are no longer performed every time we build an image. Instead, they are run on command.
This commit is contained in:
parent
199626c434
commit
12e08d7c5d
4
Makefile
Normal file
4
Makefile
Normal file
@ -0,0 +1,4 @@
|
||||
migrate:
|
||||
docker-compose run lms ./manage.py lms migrate --settings=production
|
||||
assets:
|
||||
docker-compose run lms paver update_assets lms --settings=production
|
@ -17,6 +17,11 @@ Create necessary data folders:
|
||||
|
||||
The LMS will be reachable at the following url: [http://openedx.localhost](http://openedx.localhost).
|
||||
|
||||
On the first run you will need to migrate the database and collect static assets:
|
||||
|
||||
make migrate
|
||||
make assets
|
||||
|
||||
## Development tips & tricks
|
||||
|
||||
Open a bash in the lms:
|
||||
|
@ -35,9 +35,6 @@ services:
|
||||
lms:
|
||||
build:
|
||||
context: ./lms
|
||||
args:
|
||||
RUN_MIGRATIONS: 1
|
||||
COLLECT_STATIC: 1
|
||||
volumes:
|
||||
- ./data/lms/course_static:/openedx/course_static
|
||||
- ./data/lms/data:/openedx/data
|
||||
|
@ -53,16 +53,4 @@ ENV SERVICE_VARIANT lms
|
||||
|
||||
# Run server
|
||||
EXPOSE 8000
|
||||
|
||||
# Migrate
|
||||
ARG RUN_MIGRATIONS=0
|
||||
ENV RUN_MIGRATIONS ${RUN_MIGRATIONS}
|
||||
# Collect static assets
|
||||
ARG COLLECT_STATIC=0
|
||||
ENV COLLECT_STATIC ${COLLECT_STATIC}
|
||||
|
||||
# TODO Here we wait until mysql and mongodb become available but it's a terrible solution
|
||||
CMD sleep 5 && \
|
||||
if [ "$RUN_MIGRATIONS" = "1" ] ; then ./manage.py lms migrate --settings=production ; fi && \
|
||||
if [ "$COLLECT_STATIC" = "1" ] ; then paver update_assets lms --settings=production ; fi && \
|
||||
gunicorn --name lms --bind=0.0.0.0:8000 --max-requests=1000 lms.wsgi:application
|
||||
CMD gunicorn --name lms --bind=0.0.0.0:8000 --max-requests=1000 lms.wsgi:application
|
||||
|
Loading…
Reference in New Issue
Block a user