Coder Social home page Coder Social logo

docker-wagtail-develop's Introduction

docker-wagtail-develop

A script to painlessly set up a Docker environment for development of Wagtail - inspired by vagrant-wagtail-develop

Initial work in Bristol sprint January 2020 by esperk and saevarom.

Setup

Requirements: Docker and Docker Compose (Docker Compose is included with Docker Desktop for Mac and Windows).

Open a terminal and follow those instructions:

# 1. Decide where to put the project. We use "~/Development" in our examples.
cd ~/Development
# 2. Clone the docker-wagtail-develop repository in a new "wagtail-dev" folder.
git clone https://github.com/wagtail/docker-wagtail-develop.git wagtail-dev
# 3. Move inside the new folder.
cd wagtail-dev/
# 4. Run the setup script. This will check out the bakerydemo project and local copies of wagtail and its dependencies.
./setup.sh
# 5. Build the containers
docker-compose build

It can take a while (typically 15-20 minutes) to fetch and build all dependencies and containers.

Here is the resulting folder structure:

.
├── libs          # Supporting libraries to develop Wagtail against.
├── wagtail       # Wagtail repository / codebase.
└── bakerydemo    # Wagtail Bakery project used for development.

Once the build is complete:

# 6. Start your containers and wait for them to finish their startup scripts.
docker-compose up

You might see a message like this the first time you run your containers. This is normal because the frontend container has not finished building the assets for the Wagtail admin. Just wait a few seconds for the frontend container to finish building (you should see a message like webpack compiled successfully in 15557 ms and then stop and start your containers again (Ctrl+C + docker-compose up).

WARNINGS:
?: (wagtailadmin.W001) CSS for the Wagtail admin is missing
	HINT:
            Most likely you are running a development (non-packaged) copy of
            Wagtail and have not built the static assets -
            see https://docs.wagtail.org/en/latest/contributing/developing.html

            File not found: /code/wagtail/wagtail/admin/static/wagtailadmin/css/normalize.css```

# 7. Now in a new shell, run the database setup script. The database will be persisted across container executions by Docker's Volumes system so you will only need to run this command the first time you start the database.
./setup-db.sh
# Success!

If you're running this on Linux you might get into some privilege issues that can be solved using this command (tested on Ubuntu):

CURRENT_UID=$(id -u):$(id -g) docker-compose -f docker-compose.yml -f docker-compose.linux.yml up

Alternatively, if you're using VSCode and have the "Remote - Containers" extension, you can open the command palette and select "Remote Containers - Reopen in Container" to attach VSCode to the container. This allows for much deeper debugging.

What you can do

See a list of running containers

$ docker-compose ps
  Name                Command               State           Ports
--------------------------------------------------------------------------
db         docker-entrypoint.sh postgres    Up          5432/tcp
frontend   docker-entrypoint.sh /bin/ ...   Up
web        ./manage.py runserver 0.0. ...   Up          0.0.0.0:8000->8000/tcp

Build the backend Docker image

make build

or

docker-compose build web

Bring the backend Docker container up

make start

or

docker-compose up

Stop all Docker containers

make stop

or

docker-compose stop

Stop all and remove all Docker containers

make down

or

docker-compose down

Run tests

make test

or

docker-compose exec -w /code/wagtail web python runtests.py

Run tests for a specific file

make test file=wagtail.admin.tests.test_name.py

or

docker-compose exec -w /code/wagtail web python runtests.py wagtail.admin.tests.{test_file_name_here}

Format Wagtail codebase

make format-wagtail

or

docker-compose exec -w /code/wagtail web make format-server
docker-compose exec frontend make format-client

Lint Wagtail codebase

make lint-wagtail

or

docker-compose exec -w /code/wagtail web make lint-server
docker-compose exec -w /code/wagtail web make lint-docs
docker-compose exec frontend make lint-client

Open a Django shell session

make ssh-shell

or

docker-compose exec web python manage.py shell

Open a PostgreSQL shell session

make ssh-db

or

docker-compose exec web python manage.py dbshell

Open a shell on the web server

make ssh

or

docker-compose exec web bash

Open a shell to work with the frontend code (Node/NPM)

make ssh-fe

or

docker-compose exec frontend bash

Open a shell to work within the wagtail container

make ssh-fe

or

docker-compose exec -w /code/wagtail web bash

Make migrations to the wagtail bakery site

make migrations

or

docker-compose exec web python manage.py makemigrations

Migrate the wagtail bakery site

make migrate

or

docker-compose exec web python manage.py migrate

Getting ready to contribute

Here are other actions you will likely need to do to make your first contribution to Wagtail.

Set up git remotes to Wagtail forks (run these lines outside of the Docker instances, on your machine):

cd ~/Development/wagtail-dev/wagtail
# Change the default origin remote to point to your fork.
git remote set-url origin [email protected]:<USERNAME>/wagtail.git
# Add wagtail/wagtail as the "upstream" remote.
git remote add upstream [email protected]:wagtail/wagtail.git
# Pull latest changes from all remotes / forks.
git pull --all

Contributing to Willow

You can use the same setup to contribute to Willow. You simply do the same operations to fork the Willow project and point your local copy of Willow to your fork.

See also

docker-wagtail-develop's People

Contributors

cnk avatar coredumperror avatar esperk avatar floels avatar jaspreet-singh-1032 avatar jazwiecki avatar jhonatan-lopes avatar jsma avatar laymonage avatar lb- avatar marteinn avatar nmorduch avatar realorangeone avatar rinti avatar saevarom avatar sankalpmukim avatar stevedya avatar tbrlpld avatar thibaudcolas avatar tomdyson avatar zerolab avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

docker-wagtail-develop's Issues

Refresh Auto Reload django-shell with imports and variables on code change

Every time I make a code change, I have to quit the Django shell, restart it and reimport modules, reinitialize variables, etc. While the shell can execute code from a Python file, it would be nice to have a shell with an auto-reload option that can restart with the code changes while the imports and initializations remain intact.

The issue I'm talking about is described here: https://stackoverflow.com/questions/3772260/how-to-reload-modules-in-django-shell

Run tests command does not work when using docker-compose exec.

After following all the steps in the documentation for installing docker-wagtail-develop, we tried to run the python runtests.py through docker-compose exec web python ../wagtail/runtests.py . However, the result showed that there was 0 test run. The tests will only be run if we specify a specific part such as docker-compose exec web python ../wagtail/runtests.py wagtail.core. We tried to run on two different environments:

  • WSL2 Ubuntu 20.04, Docker Desktop on Windows
  • Ubuntu 20.04 on VirtualBox

However, if we install manually by installing all dependencies and run python runtests.py directly on the command line, more than 4000 tests will be run.

We believe this is a bug that is specifically on the docker-wagtail-develop and need to be fixed so that the runtests.py will run all tests.

`setup.sh` script attempts to copy file in `bakerydemo` which doesn't exist anymore

Hi,

When running the setup.sh script locally to set up my local Wagtail development environment, I got the following error in the terminal:

Creating local settings file cp: bakerydemo/bakerydemo/settings/local.py.docker-compose-example: No such file or directory

The error comes from the following line of the script:

cp bakerydemo/bakerydemo/settings/local.py.docker-compose-example bakerydemo/bakerydemo/settings/local.py

and indeed bakerydemo/settings/local.py.docker-compose-example doesn't exist anymore in bakerydemo. It was removed in this PR merged three weeks ago.

I guess the correct command in setup.sh would be:

cp bakerydemo/bakerydemo/settings/local.py.example bakerydemo/bakerydemo/settings/local.py

I can make a PR to change it if you confirm.

Finish Github Workflow checks

Currently, the workflow runs setup.sh and builds the backend container. Ideally we would at least want to:

  • Build the front end container
  • Build the database container
  • Run the database migration scripts
  • ... something else I'm missing?

Problem docker-compose built

Having been advised at stackoverflow, I inform you about the following:
I followed the project instructions by the letter. when I arrive to the last command: docker-copose built, I received the bellow mentioned error message.

I run it from my terminal and then also via pycharm (separately), the outcome was the same.

In case it's relevant, I work on windows X, configured so docker can run on WSL2, and can confirm that I manged to run docker+wagtail on other projects.

WARNING: The PYTHONPATH variable is not set. Defaulting to a blank string.
db uses an image, skipping
Building frontend
[+] Building 8.0s (8/8) FINISHED
 => [internal] load build definition from Dockerfile.frontend                                                                                                                      0.1s
 => => transferring dockerfile: 196B                                                                                                                                               0.0s
 => [internal] load .dockerignore                                                                                                                                                  0.0s
 => => transferring context: 35B                                                                                                                                                   0.0s
 => [internal] load metadata for docker.io/library/node:10-slim                                                                                                                    3.0s
 => [internal] load build context                                                                                                                                                  4.7s
 => => transferring context: 115B                                                                                                                                                  4.7s
 => [1/3] FROM docker.io/library/node:10-slim@sha256:88932859e3d022d79161b99628c4c2c50e836437455e2d1b1a008d98367b10d6                                                              0.0s
 => CACHED [2/3] COPY ./wagtail/package.json ./wagtail/package-lock.json ./                                                                                                        0.0s
 => CACHED [3/3] RUN npm --prefix / install                                                                                                                                        0.0s
 => exporting to image                                                                                                                                                             0.1s
 => => exporting layers                                                                                                                                                            0.0s
 => => writing image sha256:00345b878ca38743fc778c1bbd72d062634ce40492f8b038501d60204ba377ad                                                                                       0.0s
 => => naming to docker.io/library/wagtail-dev_frontend                                                                                                                            0.0s
Building web
[+] Building 8.0s (6/10)
 => [internal] load build definition from Dockerfile                                                                                                                               0.0s
 => => transferring dockerfile: 925B                                                                                                                                               0.0s
 => [internal] load .dockerignore                                                                                                                                                  0.0s
 => => transferring context: 35B                                                                                                                                                   0.0s
 => [internal] load metadata for docker.io/library/python:3.7                                                                                                                      0.7s
 => CACHED [1/6] FROM docker.io/library/python:3.7@sha256:6790dfb201d2fa06b0935ea0bfa1227d2240280af56d0fe08772b11eb31402b5                                                         0.0s
 => [internal] load build context                                                                                                                                                  3.6s
 => => transferring context: 31.26MB                                                                                                                                               3.2s
 => ERROR [2/6] RUN apt-get update -y     && apt-get install -y libenchant-dev postgresql-client     && mkdir -p /code/requirements                                                6.4s

 > [2/6] RUN apt-get update -y     && apt-get install -y libenchant-dev postgresql-client     && mkdir -p /code/requirements:
#5 2.368 Get:1 http://deb.debian.org/debian bullseye InRelease [113 kB]
#5 2.368 Get:2 http://security.debian.org/debian-security bullseye-security InRelease [44.1 kB]
#5 2.409 Get:3 http://deb.debian.org/debian bullseye-updates InRelease [36.8 kB]
#5 2.839 Get:4 http://security.debian.org/debian-security bullseye-security/main amd64 Packages [28.2 kB]
#5 3.124 Get:5 http://deb.debian.org/debian bullseye/main amd64 Packages [8178 kB]
#5 5.183 Fetched 8399 kB in 3s (2731 kB/s)
#5 5.183 Reading package lists...
#5 5.652 Reading package lists...
#5 6.083 Building dependency tree...
#5 6.176 Reading state information...
#5 6.261 E: Unable to locate package libenchant-dev

executor failed running [/bin/sh -c apt-get update -y     && apt-get install -y libenchant-dev postgresql-client     && mkdir -p /code/requirements]: exit code: 100
ERROR: Service 'web' failed to build : Build failed

Setup from stratch will not automatically point to bakerydemo

Hi,

Thanks for creating this repro. I don't have much experience with wagtail and tried to activate this repro on macOS Monterey, after running docker-compose up only see "Welcome to your new Wagtail site!" on a completely white page instead of a bakerydemo-website.

I had hoped this repro would bring me up to speed promptly, now I have to start figuring out how to get that one into view, the instructions for that are unfortunately missing. 😞

Greets, Peter

Help with how to upgrade JS (Node) dependencies

I feel like I should know this but I cannot, despite trying everything I can think of, update the JS dependencies in my existing usage of this Docker environment.

I only have a basic understanding of Docker and I understand that the step Copying node_modules, this may take a few minutes... is copying from somewhere, this copy is obviously cached and contains an outdated version of node_modules.

Please can someone help me know how to update this, last time (earlier this year) I had to completely delete the entire folder and rebuild all Docker content (clone the repo) from scratch.

This time, I have been trying on an off for a week to get this working more simply and I cannot work it out.

How do others update the node_modules that is cached? I am happy to add this to the Readme if someone can point out how they do this.

Things I have tried

  • Outside of the Docker container, update the node_modules and run build etc (this helps for running tests and testing a build but this is not what the Docker actually runs with)
  • ssh-fe and npm install - does not change anything after restarting the Docker containers
  • ssh-fe and npm ci - just crashes/closes the Docker container, never finishes
  • ssh-fe and rm -rf ./node_modules - just crashes/closes the Docker container and it won't start at all again
  • Delete and rebuild the frontend container from scratch, works the first time, after restarting it reverts to some previous cache somehow

Web container not launching - windows

Hi,

I'm trying to get this going on a windows machine, and running in the below error.

(venv) PS C:\Users\rob_s\PycharmProjects\Autobiography\wagtail> docker-compose up
time="2022-10-14T09:45:31+01:00" level=warning msg="The \"PYTHONPATH\" variable is not set. Defaulting to a blank string."
[+] Running 3/0
 - Container frontend  Created                                                                                                                                                                                                     0.0s 
 - Container db        Created                                                                                                                                                                                                     0.0s 
 - Container web       Created                                                                                                                                                                                                     0.0s 
Attaching to db, frontend, web
frontend  | Copying node_modules, this may take a few minutes...
db        |
db        | PostgreSQL Database directory appears to contain a database; Skipping initialization
db        |
db        | 2022-10-14 08:45:33.580 UTC [1] LOG:  starting PostgreSQL 12.3 on x86_64-pc-linux-musl, compiled by gcc (Alpine 9.3.0) 9.3.0, 64-bit
db        | 2022-10-14 08:45:33.581 UTC [1] LOG:  listening on IPv4 address "0.0.0.0", port 5432
db        | 2022-10-14 08:45:33.581 UTC [1] LOG:  listening on IPv6 address "::", port 5432
db        | 2022-10-14 08:45:33.593 UTC [1] LOG:  listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432"
db        | 2022-10-14 08:45:33.617 UTC [21] LOG:  database system was shut down at 2022-10-14 08:45:27 UTC
db        | 2022-10-14 08:45:33.624 UTC [1] LOG:  database system is ready to accept connections
              0   0%    0.00kB/s    0:00:00 (xfr#0, to-chk=0/71361)   
frontend  | 
frontend  | > [email protected] start
frontend  | > webpack --config ./client/webpack.config.js --mode development --progress --watch
frontend  |
web       | /usr/bin/env: ‘python\r’: No such file or directory
web exited with code 127

The database and frontend containers both function as expected, but the web one exits.

I've seen a few stackoverflows recommending I
'open the file in vim or vi, and administer the following command:
:set ff=unix
Save and exit:
:wq'
however I'm not sure which file it is I'd need to open in vim and do this with.

Any advice would be much appreciated; thanks in advance!

Have a good one,
Rob

docker-compose build throws Command 'docker-compose' not found..

I was setting up the wagtail locally through the wagtail docker instruction given, I saw that docker-compose command has been renamed to docker compose without a hyphen.

So when running a command with docker-compose the following output comes:

Command 'docker-compose' not found, but can be installed with:
sudo snap install docker          # version 20.10.17, or
sudo apt  install docker-compose  # version 1.29.2-1
See 'snap info docker' for additional versions.

But I do have docker.

docker --version

Docker version 23.0.3, build 3e7cbfd

docker compose version

Docker Compose version v2.17.2

My System Specs and current software versions:

docker --version: Docker version 23.0.3, build 3e7cbfd
docker compose version: Docker Compose version v2.17.2
Using Docker desktop
lsb_release -a:

No LSB modules are available.
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.2 LTS
Release:	22.04
Codename:	jammy

Possible solutions:

  • Changing the docker-compose to docker compose: when I was following the instructions I changed the docker-compose to docker compose wherever the command comes. Also in the setup-db.sh file.

  • Mention a note in the instructions: So that new folks won't get confused.

Add ability to easily run the pattern library (Storybook)

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...

export DJANGO_SETTINGS_MODULE=wagtail.test.settings_ui
# Assumes the current environment contains a valid installation of Wagtail for local development.
./wagtail/test/manage.py migrate
./wagtail/test/manage.py createcachetable
./wagtail/test/manage.py runserver 0:8000
# In a separate terminal: - serves by default at :6006
npm run storybook

Set PYTHONPATH variable

When running Wagtail docker, the console would always output a warning about PYTHONPATH not being set. It's causing some confusion for new developers who think it's a warning that needs to be fixed.

image

The" PYTHONPATH" variable is not set. Defaulting to a blank string.

Maybe we need a solution similar to wagtail/bakerydemo#400

bakerydemo.json fixture fails to load when running setup-db.sh

Unable to successfully run ./setup-db.sh for step 7, specifically the load_initial_data manage command.

I did eventually fix the errors by going through each error the load_initial_data threw, all which relates to changes for Wagtail 6.0.

Changes I made:

  1. Replace wagtailsearch.query with wagtailsearchpromotions.query model
django.core.serializers.base.DeserializationError: Problem installing fixture '/code/bakerydemo/bakerydemo/base/fixtures/bakerydemo.json': Invalid model identifier: 'wagtailsearch.query'
  1. Replace wagtailsearch.querydailyhits with wagtailsearchpromotions.querydailyhits model
django.core.serializers.base.DeserializationError: Problem installing fixture '/code/bakerydemo/bakerydemo/base/fixtures/bakerydemo.json': Invalid model identifier: 'wagtailsearch.querydailyhits'
  1. Remove permission_type from wagtailcore.grouppagepermission model
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/db/models/options.py", line 673, in get_field
    return self.fields_map[field_name]
KeyError: 'permission_type'
  1. Remove submitted_for_moderation from wagtailcore.revision model
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/django/db/models/options.py", line 673, in get_field
    return self.fields_map[field_name]
KeyError: 'submitted_for_moderation'

After making those changes, I was able to run ./setup-db.sh successfully and the website seems to run fine.

I'll submit a PR to bakerydemo in a bit with the updated fixture.

Postgres data not being saved after stopping Docker

Hey there,

Awesome job on this! I love that you've Dockerized this for people who prefer Docker over Vagrant.

One thing I noticed was the data in the postgres db doesn't get mounted to the local machine, so every time I stop docker or stop docker compose from running I lose my data.

I think this is just a matter of adding a postgres volume in the docker-compose.yml file.

Naming

This all looks great! I just wanted to bring up a minor issue - namely that on my machine at least, the naming of the containers is inconsistent with the readme.

On my machine, they show as dockerwagtaildevelop_web_1, whereas in the readme they're written as docker-wagtail-develop_web_1. Very minor issue, and of course happy to submit a PR to fix typos, but just checking whether this is in fact inconsistent between machines, and if so whether that should be standardised?

`bakerydemo-settings-local.py.example` is invalid and not used

This file was introduced in PR #55 (issue #54) because of upstream bakerydemo changes in wagtail/bakerydemo#393. The problem is that the introduced example settings attempts to:

from bakerydemo.settings.dev import * # noqa

This introduces a circular import because bakerydemo.settings.dev does this:

try:
    from .local import *  # noqa
except ImportError:
    pass

Is there any reason to keep bakerydemo-settings-local.py.example around or can it be removed and the build script be updated to simply copy from the actual bakerydemo/settings/local.py.example (which is currently empty)?

# Set up bakerydemo to use the Postgres database in the sister container
if [ ! -f bakerydemo/bakerydemo/settings/local.py ]; then
echo "Creating local settings file"
cp bakerydemo-settings-local.py.example bakerydemo/bakerydemo/settings/local.py
fi

docs: slightly incorrect setup instructions

image
image
Slightly incorrect setup instructions. Because the git clone command given was not working, the cd command also needed to be changed. I think it is a simple documentation fix! I would be happy to be assigned this issue.

Problem with starting the container

Hi,
Thank you for this rich and detailed repo.
I followed all the steps in the ReadME file but there was a problem with the start container step. I tried both command
docker-compose up and
CURRENT_UID=$(id -u):$(id -g) docker-compose -f docker-compose.yml -f docker-compose.linux.yml up
the container started to build but it stopped after the webpack.progress completed %100 and didn't proceed further:

frontend    | runtime modules 135 KiB 273 modules
frontend    | modules by path ./node_modules/ 3.05 MiB 560 modules
frontend    | modules by path ./client/src/ 549 KiB
frontend    |   modules by path ./client/src/components/ 365 KiB 59 modules
frontend    |   modules by path ./client/src/entrypoints/ 166 KiB 35 modules
frontend    |   modules by path ./client/src/utils/ 5.33 KiB
frontend    |     modules by path ./client/src/utils/*.js 3.02 KiB 4 modules
frontend    |     modules by path ./client/src/utils/*.ts 2.31 KiB 2 modules
frontend    |   modules by path ./client/src/includes/*.js 3.8 KiB 3 modules
frontend    |   modules by path ./client/src/api/ 6.79 KiB
frontend    |     ./client/src/api/admin.ts 5.3 KiB [built] [code generated]
frontend    |     ./client/src/api/client.js 1.49 KiB [built] [code generated]
frontend    |   ./client/src/config/wagtailConfig.js 735 bytes [built] [code generated]
frontend    |   ./client/src/index.ts 1.6 KiB [built] [code generated]
frontend    | external "jQuery" 42 bytes [built] [code generated]
frontend    | webpack compiled successfully in 27108 ms
frontend    | <s> [webpack.Progress] 99% cache store build dependencies
frontend    | <s> [webpack.Progress] 99% cache store build dependencies
frontend    | <s> [webpack.Progress] 99% cache begin idle
frontend    | <s> [webpack.Progress] 99% cache begin idle
frontend    | <s> [webpack.Progress] 100% 
frontend    | 

can you please help me to understand the problem and solve it?

Error Building Frontend Assets in Docker Setup

I'm encountering an issue while trying to use "docker-compose build" for setting up wagtail project using Docker. The issue seems to be related to the COPY command for the package.json and package-lock.json files in the Dockerfile.frontend.

Error Details:
During the Docker build process for the frontend service, I'm seeing the following error message:

`failed to solve: failed to compute cache key: failed to calculate checksum of ref e1bce70e-3120-4a7b-99ba-53a746beadee::4yljc7iekkcpqwccr7citf7g3: "/wagtail/package.json": not found
`

Dockerfile.frontend:

`FROM node:18-slim
LABEL maintainer="[email protected]"

RUN apt-get update && apt-get install rsync -y
COPY ./wagtail/package.json ./wagtail/package-lock.json ./

RUN npm --prefix / install --loglevel info
`

docker-compose.yml:

`services:
---------
        frontend:
    container_name: "frontend"
    build:
      context: .
      dockerfile: Dockerfile.frontend
    working_dir: /code/wagtail
    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 start"
    restart: "no"
    tty: true
`

Troubleshooting Steps Taken:

  • Verified correct paths and file locations in Dockerfile and docker-compose.yml.
  • Checked Docker build context.
  • Ensured proper file permissions.

Additional Notes:
I have tried several solutions based on the suggestions in the Wagtail documentation and other sources, but I'm still unable to resolve the issue. The error seems to be related to the COPY step for the package.json and package-lock.json files.

Any help or guidance in troubleshooting and resolving this issue would be greatly appreciated.

Thank you!

error on build using raspberry pi 4

after executed the folowing commands :

git clone https://github.com/wagtail/docker-wagtail-develop.git -b improve-build-and-run
cd docker-wagtail-develop/
./setup.sh
 sudo docker-compose build

returned this error:

npm ERR! errno EAI_AGAIN
npm ERR! request to https://registry.npmjs.org/npm failed, reason: getaddrinfo EAI_AGAIN registry.npmjs.org:443

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2021-02-26T14_04_19_641Z-debug.log
ERROR: Service 'frontend' failed to build: The command '/bin/sh -c npm i npm@latest -g' returned a non-zero code: 1

Make test file= does not correctly filter test files

Summary

make test file=... the file CLI param does not get used at all, instead you need to run make test FILE=....

Steps to reproduce

  1. On macOS 12.6.2 with the Docker Wagtail develop setup
  2. Run make test file=wagtail.admin.tests.test_workflows
  3. Expected: It should only run the tests in the file wagtail/admin/tests/test_workflows.py (~88 tests)
  4. Actual: It ignores the file param and runs all tests (~5300 tests)

Logs

With file (lowercase) - fails:

➜ make test file=wagtail.admin.tests.test_workflows
docker-compose exec -w /code/wagtail web python runtests.py 
WARN[0000] The "PYTHONPATH" variable is not set. Defaulting to a blank string. 
Found 5331 test(s).
Creating test database for alias 'default'...

With FILE (uppercase) - works:

➜ make test FILE=wagtail.admin.tests.test_workflows
docker-compose exec -w /code/wagtail web python runtests.py wagtail.admin.tests.test_workflows
WARN[0000] The "PYTHONPATH" variable is not set. Defaulting to a blank string. 
Found 88 test(s).
Creating test database for alias 'default'...

Recommended solution

I am not sure if this is a makefile specific thing but we should probably support both casing for flexibility.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.