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

Assets 404 when restarting containers #1

Open
robtec opened this issue Apr 23, 2023 · 2 comments
Open

Assets 404 when restarting containers #1

robtec opened this issue Apr 23, 2023 · 2 comments

Comments

@robtec
Copy link

robtec commented Apr 23, 2023

I have a fork of this project (https://github.com/robtec/vendure-docker-deploy)

When I docker compose down then docker compose up -d I lose the test asset images on my site

Screenshot 2023-04-23 at 01 41 30

I persist the database as a docker volume so this is not deleted on the docker compose down

I'm guessing its repopulating the database or something on startup?

@robtec
Copy link
Author

robtec commented Apr 23, 2023

I just tested adding a product (non seeded/populated one) and it also results in a 404 asset after compose cycle

Screenshot 2023-04-23 at 01 55 47

@agoransson
Copy link

I had the same issue, I don't think it has to do with database - more likely it's the container that is rebuilt and the locally stored data would be deleted inside the container. I guess.

I overcame this by attaching a new volume and modifying the assetplugin path to that persistent volume mount. Worth noting is that I am using Northflank. But the same should be possible if you attach f.ex. a docker volume to your compose setup and change the asset plugin to the correct mount path.

        AssetServerPlugin.init({
            route: 'assets',
            assetUploadDir: '/assets'
        }),

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

2 participants