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

Fresh install in env PROD with docker fail #832

Closed
duchnoun opened this issue Sep 30, 2022 · 11 comments
Closed

Fresh install in env PROD with docker fail #832

duchnoun opened this issue Sep 30, 2022 · 11 comments
Assignees

Comments

@duchnoun
Copy link

Hi,

On a fresh system (clear all image , old build ect..)


git clone https://github.com/Sylius/Sylius-Standard.git
cd Sylius-Standard
export MYSQL_PASSWORD=SLyPJLaye7
docker-compose -f docker-compose.prod.yml up -d
docker-compose exec php bin/console sylius:fixtures:load --no-interaction

After visiting the website : error 500.

log 👍

[2022-09-30T10:52:52.890581+00:00] request.CRITICAL: Exception thrown when handling an exception (Twig\Error\RuntimeError: An exception has been thrown during the rendering of a template ("Could not find the entrypoints file from Webpack: the file "/srv/sylius/public/build/shop/entrypoints.json" does not exist."). at /srv/sylius/templates/bundles/SyliusShopBundle/_styles.html.twig line 1) {"exception":"[object] (Twig\Error\RuntimeError(code: 0): An exception has been thrown during the rendering of a template ("Could not find the entrypoints file from Webpack: the file "/srv/sylius/public/build/shop/entrypoints.json" does not exist."). at /srv/sylius/templates/bundles/SyliusShopBundle/_styles.html.twig:1)\n[previous exception] [object] (InvalidArgumentException(code: 0): Could not find the entrypoints file from Webpack: the file "/srv/sylius/public/build/shop/entrypoints.json" does not exist. at /srv/sylius/vendor/symfony/webpack-encore-bundle/src/Asset/EntrypointLookup.php:124)"} []

--- in dev mode it work .. ---

if i check in docker php container there is no /srv/sylius/public/build folder. (but it exist on the host)

Where i mistake ?

Thanks.

@duchnoun
Copy link
Author

duchnoun commented Oct 3, 2022

no body got a response ? thanks :)

@vvasiloi
Copy link
Contributor

vvasiloi commented Oct 3, 2022

Run yarn install and yarn build before that.

@vvasiloi
Copy link
Contributor

vvasiloi commented Oct 3, 2022

@Ferror got an idea how to solve this?

@Ferror
Copy link
Contributor

Ferror commented Oct 3, 2022

I just got aware of the issue. It's because of the PR: #831 I will try to pull off the changes

@vvasiloi
Copy link
Contributor

vvasiloi commented Oct 3, 2022

@Ferror I don't understand how is that PR related to this issue.

@Ferror
Copy link
Contributor

Ferror commented Oct 3, 2022

Well simply as it gets the entires with webpack inside the docker does not load/generate properly

@Ferror Ferror self-assigned this Oct 3, 2022
@vvasiloi
Copy link
Contributor

vvasiloi commented Oct 3, 2022

They're not generated at all, because docker-compose.prod.yml has no nodejs container.
There's no yarn install or yarn build executed anywhere there.

@Ferror
Copy link
Contributor

Ferror commented Oct 3, 2022

The node container is used during the creation of the Nginx container for production. There is no need of having the node container stay alive.

@vvasiloi
Copy link
Contributor

vvasiloi commented Oct 3, 2022

It's needed in the PHP container when using Webpack though.

@Ferror
Copy link
Contributor

Ferror commented Oct 3, 2022

I prepared the fix. I guess tomorrow morning it's gonna be merged :) #835

jakubtobiasz added a commit that referenced this issue Oct 4, 2022
…ror)

This PR was merged into the 1.12 branch.

Discussion
----------

FYI #832

The PHP container now needs the frontend files. This is not the most distinguished solution, but it works. I will spend some more time polishing it. But now it is required to fix the 1.12 branch.

PS. it worked on the development image only because the command generated the files and syncs with local filesystem

Commits
-------

9f5f794 [docker]Integrate production config docker with Webpack
@jakubtobiasz
Copy link
Contributor

Hi @duchnoun 🙋🏼‍♂️!

Thanks for reporting, fix is merged so I'm closing this issue. In case of further problems feel free to reopen this issue or create a new one.

windragon0910 added a commit to windragon0910/symfony_ecom_framework that referenced this issue Oct 25, 2023
…ror)

This PR was merged into the 1.12 branch.

Discussion
----------

FYI Sylius/Sylius-Standard#832

The PHP container now needs the frontend files. This is not the most distinguished solution, but it works. I will spend some more time polishing it. But now it is required to fix the 1.12 branch.

PS. it worked on the development image only because the command generated the files and syncs with local filesystem

Commits
-------

9f5f794e782976439958fd519c795f087d261bb7 [docker]Integrate production config docker with Webpack
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

4 participants