-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to easily run the pattern library (Storybook) #47
Comments
Here is my first attempt but it's failing - not sure how to get the right 'file' path access and also not sure how to resolve the issue where the non-profile services still run (hence the port conflict as pattern library is hard-coded to use port 8000). This is using the profiles feature - https://docs.docker.com/compose/profiles/ db_test:
container_name: "db_test"
image: postgres:12.3-alpine
environment:
POSTGRES_USER: wagtail
POSTGRES_DB: wagtail
POSTGRES_PASSWORD: changeme
volumes:
- postgres-data:/var/lib/postgresql/data
restart: "no"
expose:
- "5432"
web_test:
container_name: "web_test"
profiles:
- pattern-library
build: ./
working_dir: /code/wagtail
command:
- ./wagtail/test/manage.py migrate
- ./wagtail/test/manage.py createcachetable
- python manage.py runserver 0.0.0.0:8000
restart: "no"
volumes:
- ./wagtail:/code/wagtail:delegated,rw
- node_modules:/code/wagtail/node_modules/
ports:
- "8020:8000"
environment:
DJANGO_SETTINGS_MODULE: "wagtail.test.settings_ui"
DATABASE_URL: "postgres://wagtail:changeme@db/wagtail"
PYTHONPATH: "/code/wagtail:/code/wagtail:$PYTHONPATH"
depends_on:
- db_test
- storybook
storybook:
container_name: "storybook"
profiles:
- pattern-library
build:
context: .
dockerfile: Dockerfile.frontend
working_dir: /code/wagtail
ports:
- "6006:6006"
volumes:
- ./wagtail:/code/wagtail:delegated,rw
- node_modules:/code/wagtail/node_modules/
command: bash -c "echo 'Copying node_modules, this may take a few minutes...' && rsync -rah --info=progress2 /node_modules /code/wagtail/ && npm run storybook"
restart: "no"
tty: true makefile pattern-library: ## Set up the test database and application then run the pattern library
docker-compose --profile pattern-library up |
Goodness, Docker keeps sprouting features and I can't keep up ;) As far as setting a I'm still digesting the profiles feature...that would mean we could leave the It would also allow us to have a single giant docker-compose.yml with all the optional services vs what I'm used to, which is specifying carefully constructed compose files to be merged into a single config e.g. As far as Django settings, my PR only introduced an At any rate, I did not want to step on the toes of the existing |
It would be great to have a single command to set up and run the pattern library (Storybook).
Development instructions are here https://docs.wagtail.org/en/stable/contributing/developing.html#using-the-pattern-library
This would need to run two servers, the Wagtail / Django server against the test database and also the Storybook local development server.
e.g.
make pattern-library
- which would run the following...The text was updated successfully, but these errors were encountered: