Skip to content
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

Error Building Frontend Assets in Docker Setup #59

Open
rohitsrma opened this issue Aug 7, 2023 · 3 comments
Open

Error Building Frontend Assets in Docker Setup #59

rohitsrma opened this issue Aug 7, 2023 · 3 comments
Assignees

Comments

@rohitsrma
Copy link

rohitsrma commented Aug 7, 2023

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="hello@wagtail.org"

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!

@saevarom
Copy link
Collaborator

saevarom commented Aug 8, 2023

Thank you @rohitsrma, we will investigate

@saevarom saevarom self-assigned this Aug 8, 2023
@rohitsrma rohitsrma closed this as not planned Won't fix, can't repro, duplicate, stale Sep 9, 2023
@rohitsrma rohitsrma reopened this Sep 27, 2023
@lb-
Copy link
Member

lb- commented Sep 27, 2023

We've had another new contributor run into this.

@lb-
Copy link
Member

lb- commented Dec 4, 2023

Just had another new contributor run into this problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants