When you run bun --bun run vite build
, it outputs the files to the dist
directory, which is the default directory for vite.
build.outDir
- Type:
string
- Default:
dist
But in your Dockerfile you try to copy the files from the /usr/src/app/build
directory instead. The error message is self-explanatory:
40 | >>> COPY --from=prerelease /usr/src/app/build . -------------------- ERROR: failed to solve: ...: "/usr/src/app/build": not found
To resolve this, you can either:
add --outDir build
to RUN bun --bun run vite build
line:
RUN bun --bun run vite build --outDir build
or replace /usr/src/app/build
with /usr/src/app/dist
.