Skip to content

Docker - @symfony/ux-swup/package.json not found #37

Open
@adrienlamotte

Description

I have a docker for my Symfony 5 project, but I can't make it work with @symfony/ux-swup. When I try to build with npm run build, I have the error bellow in Docker :

Step #0:  error  in ./assets/controllers.json
Step #0: Syntax Error: Error: The file "@symfony/ux-swup/package.json" could not be found. Try running "yarn install --force".

Here is my docker file relevant parts :

FROM composer:1.9 as build
WORKDIR /app/
COPY composer.json composer.lock /app/
RUN composer global require hirak/prestissimo && \
    composer install

# ------------------------------------------------------

FROM php:7.4.5-apache
RUN apt-get update && apt-get install -y 

COPY --from=build /app/vendor /var/www/app/vendor

WORKDIR /var/www/app
COPY . /var/www/app/

# ------------------------------------------------------

FROM node:12-alpine
WORKDIR /var/www/app

COPY package*.json webpack.config.js /var/www/app/
COPY assets /var/www/app/assets

RUN npm install && \
    npm run build

I have noticed that in the package.js, ux-swup il referenced by :

"@symfony/ux-swup": "file:vendor/symfony/ux-swup/Resources/assets",

Not sure if this might cause the problem...

Any clues?
Thanks!

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions