Skip to content
Snippets Groups Projects
Commit d19bd53b authored by Régis Behmo's avatar Régis Behmo
Browse files

Fix missing bundle static assets in dev mode

The static assets need to be properly collected in the development image
in order to have a working webpack-stats.json file.

The /openedx/staticfiles folder is still bind-mounted in the docker
image in order to have a working `watchthemes` command.

This is for issue #235, again.
parent 9b6afa20
No related branches found
No related tags found
No related merge requests found
...@@ -10,6 +10,13 @@ RUN apt update && \ ...@@ -10,6 +10,13 @@ RUN apt update && \
RUN pip install -r requirements/edx/development.txt RUN pip install -r requirements/edx/development.txt
RUN pip install ipdb==0.12.2 ipython==5.8.0 RUN pip install ipdb==0.12.2 ipython==5.8.0
# Recompile static assets: in development mode all static assets are stored in edx-platform,
# and the location of these files is stored in webpack-stats.json. If we don't recompile
# static assets, then production assets will be served instead.
RUN rm -r /openedx/staticfiles && \
mkdir /openedx/staticfiles && \
openedx-assets webpack --env=dev
# Copy new entrypoint (to take care of permission issues at runtime) # Copy new entrypoint (to take care of permission issues at runtime)
COPY ./bin /openedx/bin COPY ./bin /openedx/bin
RUN chmod a+x /openedx/bin/* RUN chmod a+x /openedx/bin/*
...@@ -20,5 +27,3 @@ RUN create-user.sh $USERID ...@@ -20,5 +27,3 @@ RUN create-user.sh $USERID
# Default django settings # Default django settings
ENV SETTINGS tutor.development ENV SETTINGS tutor.development
# TODO recompile static assets and point to edx-platform
\ No newline at end of file
...@@ -5,8 +5,6 @@ services: ...@@ -5,8 +5,6 @@ services:
&openedx-service &openedx-service
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX_DEV }} image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX_DEV }}
volumes: volumes:
# static assets
- ../../data/openedx/staticfiles:/openedx/staticfiles
# theme files # theme files
- ../build/openedx/themes:/openedx/themes - ../build/openedx/themes:/openedx/themes
# editable requirements # editable requirements
...@@ -25,5 +23,6 @@ services: ...@@ -25,5 +23,6 @@ services:
watchthemes: watchthemes:
<<: *openedx-service <<: *openedx-service
command: openedx-assets watch-themes --env dev command: openedx-assets watch-themes --env dev
restart: unless-stopped
{{ patch("local-docker-compose-dev-services")|indent(2) }} {{ patch("local-docker-compose-dev-services")|indent(2) }}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment