React-Router and Fly.io through Github Actions, works, but no site is being displayed

hey all,

I have a react-router app, currently nothing on the server-side, just a client marketing site. I have set up the github actions and the fly deploy, Everything is building correctly but when I go to my fly.dev site, nothing is loading and times out.

:waving_hand: Thanks for trying fly.io out! Is it possible for you to share your Dockerfile, recent machine logs, and (maybe) which app we’re talking about?

This is the current dockerfile that came with the template I started with:

COPY . /app
WORKDIR /app
RUN npm ci

FROM node:20-alpine AS production-dependencies-env
COPY ./package.json package-lock.json /app/
WORKDIR /app
RUN npm ci --omit=dev

FROM node:20-alpine AS build-env
COPY . /app/
COPY --from=development-dependencies-env /app/node_modules /app/node_modules
WORKDIR /app
RUN npm run build

FROM node:20-alpine
COPY ./package.json package-lock.json /app/
COPY --from=production-dependencies-env /app/node_modules /app/node_modules
COPY --from=build-env /app/build /app/build
WORKDIR /app
CMD ["npm", "run", "start"]`




[internal] load build definition from Dockerfile
transferring 723/0 0.003
[internal] load metadata for Docker Hub Container Image Library | App Containerization
[internal] load .dockerignore
[development-dependencies-env 1/4] FROM Docker Hub Container Image Library | App Containerization
resolve Docker Hub Container Image Library | App Containerization 0/0 0.009
sha256:a8c23aebbdc3af49dc775b14ff5448d1c781f6914c6b0fe3b25aeb9a47b81f75 444/444 0.088
sha256:fe37ac954e5e4e10ba5e1d2ab0ee1e17e094c8a2674f93bdaecfd09d4d7e7d3d 1260603/1260603 0.191
sha256:ea00b69f938d915f75eb18ab43debcf665e0cf852e9e1c169707e4b49746d26b 42630541/42630541 0.823
sha256:6e771e15690e2fabf2332d3a3b744495411d6e0b00b2aea64419b58b0066cf81 3993029/3993029 0.496
extracting 0/0 0.067
extracting 0/0 0.587
extracting 0/0 0.034
extracting 0/0 0.014
[internal] load build context
transferring 482402180/0 1.576
[development-dependencies-env 2/4] COPY . /app
[production-dependencies-env 2/4] COPY ./package.json package-lock.json /app/
[build-env 2/5] COPY . /app/
[production-dependencies-env 3/4] WORKDIR /app
[production-dependencies-env 4/4] RUN npm ci --omit=dev

added 178 packages, and audited 179 packages in 5s

33 packages are looking for funding
run `npm fund` for details

found 0 vulnerabilities
npm notice
npm notice New major version of npm available! 10.8.2 -> 11.3.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.3.0
npm notice To update run: npm install -g npm@11.3.0
npm notice

[development-dependencies-env 3/4] WORKDIR /app
[development-dependencies-env 4/4] RUN npm ci

added 465 packages, and audited 466 packages in 7s

63 packages are looking for funding
run `npm fund` for details

found 0 vulnerabilities
npm notice
npm notice New major version of npm available! 10.8.2 -> 11.3.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.3.0
npm notice To update run: npm install -g npm@11.3.0
npm notice

[stage-3 3/5] COPY --from=production-dependencies-env /app/node_modules /app/node_modules
[build-env 3/5] COPY --from=development-dependencies-env /app/node_modules /app/node_modules
[build-env 4/5] WORKDIR /app
[build-env 5/5] RUN npm run build

> build
> react-router build
vite v6.3.4 building for production...
transforming...
βœ“ 860 modules transformed.
rendering chunks...
computing gzip size...
build/client/.vite/manifest.json                  4.78 kB β”‚ gzip:  0.76 kB
build/client/assets/logo-dark-pX2395Y0.svg        6.10 kB β”‚ gzip:  2.40 kB
build/client/assets/logo-light-CVbx2LBR.svg       6.13 kB β”‚ gzip:  2.41 kB
build/client/assets/home-DcyOTdnk.css             0.18 kB β”‚ gzip:  0.13 kB
build/client/assets/listGrid-D6Fwm6md.css         1.37 kB β”‚ gzip:  0.55 kB
build/client/assets/pricing-BZaf62Iq.css          1.41 kB β”‚ gzip:  0.60 kB
build/client/assets/contactBanner-DbYsBRCU.css    1.95 kB β”‚ gzip:  0.69 kB
build/client/assets/root-DK4w8i4q.css             2.53 kB β”‚ gzip:  0.82 kB
build/client/assets/app-DsZuFtUt.css             10.49 kB β”‚ gzip:  3.02 kB
build/client/assets/work-KCj3tkxs.js              0.50 kB β”‚ gzip:  0.35 kB
build/client/assets/index-CY32Ck_D.js             0.83 kB β”‚ gzip:  0.52 kB
build/client/assets/listGrid-sJRym8u1.js          1.32 kB β”‚ gzip:  0.52 kB
build/client/assets/about-BAsYUHfM.js             2.04 kB β”‚ gzip:  0.94 kB
build/client/assets/contactBanner-CGkT28y9.js     2.50 kB β”‚ gzip:  1.06 kB
build/client/assets/services-Dq9E_l3R.js          2.75 kB β”‚ gzip:  1.41 kB
build/client/assets/contact-rwmmH1RC.js           2.83 kB β”‚ gzip:  1.02 kB
build/client/assets/pricing-Dul7wutk.js           3.76 kB β”‚ gzip:  1.79 kB
build/client/assets/root-DtLgBHuk.js              4.88 kB β”‚ gzip:  1.84 kB
build/client/assets/home-ZojLr9zZ.js              5.21 kB β”‚ gzip:  1.85 kB
build/client/assets/link-CnLVys9_.js             41.94 kB β”‚ gzip: 13.05 kB
build/client/assets/chunk-AYJ5UCUI-T-clhmxa.js  116.35 kB β”‚ gzip: 39.13 kB
build/client/assets/entry.client-D0u6Ql6o.js    181.43 kB β”‚ gzip: 57.32 kB
βœ“ built in 1.43s
vite v6.3.4 building SSR bundle for production...
transforming...
"default" is imported from external module "react" but never used in "virtual:react-router/with-props", "app/routes/contact.tsx", "app/components/contactBanner/contactBanner.tsx", "app/components/listGrid/listGrid.tsx", "app/components/pageBanner/pageBanner.tsx", "app/components/button/button.tsx", "app/routes/home.tsx", "app/components/pricingCards/pricingCards.tsx", "app/navigation/navBar.tsx", "app/navigation/footer.tsx" and "app/root.tsx".
"AcademicCapIcon" and "ChatBubbleLeftEllipsisIcon" are imported from external module "@heroicons/react/24/outline" but never used in "app/routes/home.tsx", "app/components/pricingCards/pricingCards.tsx" and "app/navigation/navBar.tsx".
"motion" and "AnimatePresence" are imported from external module "framer-motion" but never used in "app/root.tsx".
βœ“ 32 modules transformed.
rendering chunks...
build/server/.vite/manifest.json                0.52 kB
build/server/assets/logo-dark-pX2395Y0.svg      6.10 kB
build/server/assets/logo-light-CVbx2LBR.svg     6.13 kB
build/server/assets/server-build-D3WUOOqw.css  17.92 kB
build/server/index.js                          42.69 kB
βœ“ built in 131ms
npm notice
npm notice New major version of npm available! 10.8.2 -> 11.3.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.3.0
npm notice To update run: npm install -g npm@11.3.0
npm notice

[stage-3 4/5] COPY --from=build-env /app/build /app/build
[stage-3 5/5] WORKDIR /app
exporting to image
exporting layers 0/0 9.162
exporting manifest sha256:aa4de4330e8fd75d5e27c12eaa0077d2b18188021e9b405686d57f5109cc44d8 0/0 0.004
exporting config sha256:71357da592e8a71d0f74b6cc92d905b2406392cb371d3810d410265d82e76334 0/0 0.003
exporting attestation manifest sha256:6e7b98711e9b42300289514ff00a0094dacfedcc8aa49ddf389bee649b9b4e8b 0/0 0.005
exporting manifest list sha256:6325cec76978445d731e446ca8db9e751b45938d2b899771ba68388f5519d962 0/0 0.002
naming to moby-dangling@sha256:6325cec76978445d731e446ca8db9e751b45938d2b899771ba68388f5519d962 0/0 0.001
unpacking to moby-dangling@sha256:6325cec76978445d731e446ca8db9e751b45938d2b899771ba68388f5519d962 0/0 2.367

The app is https://hatchbytestudios-young-rain-9090.fly.dev


Thanks

Hey! My DockerFile that came with the template is this:

FROM node:20-alpine AS development-dependencies-env
COPY . /app
WORKDIR /app
RUN npm ci

FROM node:20-alpine AS production-dependencies-env
COPY ./package.json package-lock.json /app/
WORKDIR /app
RUN npm ci --omit=dev

FROM node:20-alpine AS build-env
COPY . /app/
COPY --from=development-dependencies-env /app/node_modules /app/node_modules
WORKDIR /app
RUN npm run build

FROM node:20-alpine
COPY ./package.json package-lock.json /app/
COPY --from=production-dependencies-env /app/node_modules /app/node_modules
COPY --from=build-env /app/build /app/build
WORKDIR /app
CMD ["npm", "run", "start"]

Logs:

[internal] load build definition from Dockerfile
	transferring 723/0 0.003
[internal] load metadata for docker.io/library/node:20-alpine
[internal] load .dockerignore
[development-dependencies-env 1/4] FROM docker.io/library/node:20-alpine@sha256:c628bdc7ebc7f95b1b23249a445eb415ce68ae9def8b68364b35ee15e3065b0f
	resolve docker.io/library/node:20-alpine@sha256:c628bdc7ebc7f95b1b23249a445eb415ce68ae9def8b68364b35ee15e3065b0f 0/0 0.009
	sha256:a8c23aebbdc3af49dc775b14ff5448d1c781f6914c6b0fe3b25aeb9a47b81f75 444/444 0.088
	sha256:fe37ac954e5e4e10ba5e1d2ab0ee1e17e094c8a2674f93bdaecfd09d4d7e7d3d 1260603/1260603 0.191
	sha256:ea00b69f938d915f75eb18ab43debcf665e0cf852e9e1c169707e4b49746d26b 42630541/42630541 0.823
	sha256:6e771e15690e2fabf2332d3a3b744495411d6e0b00b2aea64419b58b0066cf81 3993029/3993029 0.496
	extracting 0/0 0.067
	extracting 0/0 0.587
	extracting 0/0 0.034
	extracting 0/0 0.014
[internal] load build context
	transferring 482402180/0 1.576
[development-dependencies-env 2/4] COPY . /app
[production-dependencies-env 2/4] COPY ./package.json package-lock.json /app/
[build-env 2/5] COPY . /app/
[production-dependencies-env 3/4] WORKDIR /app
[production-dependencies-env 4/4] RUN npm ci --omit=dev
	
	added 178 packages, and audited 179 packages in 5s
	
	33 packages are looking for funding
	run `npm fund` for details
	
	found 0 vulnerabilities
	npm notice
	npm notice New major version of npm available! 10.8.2 -> 11.3.0
	npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.3.0
	npm notice To update run: npm install -g npm@11.3.0
	npm notice
[development-dependencies-env 3/4] WORKDIR /app
[development-dependencies-env 4/4] RUN npm ci
	
	added 465 packages, and audited 466 packages in 7s
	
	63 packages are looking for funding
	run `npm fund` for details
	
	found 0 vulnerabilities
	npm notice
	npm notice New major version of npm available! 10.8.2 -> 11.3.0
	npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.3.0
	npm notice To update run: npm install -g npm@11.3.0
	npm notice
[stage-3 3/5] COPY --from=production-dependencies-env /app/node_modules /app/node_modules
[build-env 3/5] COPY --from=development-dependencies-env /app/node_modules /app/node_modules
[build-env 4/5] WORKDIR /app
[build-env 5/5] RUN npm run build
	
	> build
	> react-router build
	vite v6.3.4 building for production...
	transforming...
	βœ“ 860 modules transformed.
	rendering chunks...
	computing gzip size...
	build/client/.vite/manifest.json                  4.78 kB β”‚ gzip:  0.76 kB
	build/client/assets/logo-dark-pX2395Y0.svg        6.10 kB β”‚ gzip:  2.40 kB
	build/client/assets/logo-light-CVbx2LBR.svg       6.13 kB β”‚ gzip:  2.41 kB
	build/client/assets/home-DcyOTdnk.css             0.18 kB β”‚ gzip:  0.13 kB
	build/client/assets/listGrid-D6Fwm6md.css         1.37 kB β”‚ gzip:  0.55 kB
	build/client/assets/pricing-BZaf62Iq.css          1.41 kB β”‚ gzip:  0.60 kB
	build/client/assets/contactBanner-DbYsBRCU.css    1.95 kB β”‚ gzip:  0.69 kB
	build/client/assets/root-DK4w8i4q.css             2.53 kB β”‚ gzip:  0.82 kB
	build/client/assets/app-DsZuFtUt.css             10.49 kB β”‚ gzip:  3.02 kB
	build/client/assets/work-KCj3tkxs.js              0.50 kB β”‚ gzip:  0.35 kB
	build/client/assets/index-CY32Ck_D.js             0.83 kB β”‚ gzip:  0.52 kB
	build/client/assets/listGrid-sJRym8u1.js          1.32 kB β”‚ gzip:  0.52 kB
	build/client/assets/about-BAsYUHfM.js             2.04 kB β”‚ gzip:  0.94 kB
	build/client/assets/contactBanner-CGkT28y9.js     2.50 kB β”‚ gzip:  1.06 kB
	build/client/assets/services-Dq9E_l3R.js          2.75 kB β”‚ gzip:  1.41 kB
	build/client/assets/contact-rwmmH1RC.js           2.83 kB β”‚ gzip:  1.02 kB
	build/client/assets/pricing-Dul7wutk.js           3.76 kB β”‚ gzip:  1.79 kB
	build/client/assets/root-DtLgBHuk.js              4.88 kB β”‚ gzip:  1.84 kB
	build/client/assets/home-ZojLr9zZ.js              5.21 kB β”‚ gzip:  1.85 kB
	build/client/assets/link-CnLVys9_.js             41.94 kB β”‚ gzip: 13.05 kB
	build/client/assets/chunk-AYJ5UCUI-T-clhmxa.js  116.35 kB β”‚ gzip: 39.13 kB
	build/client/assets/entry.client-D0u6Ql6o.js    181.43 kB β”‚ gzip: 57.32 kB
	βœ“ built in 1.43s
	vite v6.3.4 building SSR bundle for production...
	transforming...
	"default" is imported from external module "react" but never used in "virtual:react-router/with-props", "app/routes/contact.tsx", "app/components/contactBanner/contactBanner.tsx", "app/components/listGrid/listGrid.tsx", "app/components/pageBanner/pageBanner.tsx", "app/components/button/button.tsx", "app/routes/home.tsx", "app/components/pricingCards/pricingCards.tsx", "app/navigation/navBar.tsx", "app/navigation/footer.tsx" and "app/root.tsx".
	"AcademicCapIcon" and "ChatBubbleLeftEllipsisIcon" are imported from external module "@heroicons/react/24/outline" but never used in "app/routes/home.tsx", "app/components/pricingCards/pricingCards.tsx" and "app/navigation/navBar.tsx".
	"motion" and "AnimatePresence" are imported from external module "framer-motion" but never used in "app/root.tsx".
	βœ“ 32 modules transformed.
	rendering chunks...
	build/server/.vite/manifest.json                0.52 kB
	build/server/assets/logo-dark-pX2395Y0.svg      6.10 kB
	build/server/assets/logo-light-CVbx2LBR.svg     6.13 kB
	build/server/assets/server-build-D3WUOOqw.css  17.92 kB
	build/server/index.js                          42.69 kB
	βœ“ built in 131ms
	npm notice
	npm notice New major version of npm available! 10.8.2 -> 11.3.0
	npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.3.0
	npm notice To update run: npm install -g npm@11.3.0
	npm notice
[stage-3 4/5] COPY --from=build-env /app/build /app/build
[stage-3 5/5] WORKDIR /app
exporting to image
	exporting layers 0/0 9.162
	exporting manifest sha256:aa4de4330e8fd75d5e27c12eaa0077d2b18188021e9b405686d57f5109cc44d8 0/0 0.004
	exporting config sha256:71357da592e8a71d0f74b6cc92d905b2406392cb371d3810d410265d82e76334 0/0 0.003
	exporting attestation manifest sha256:6e7b98711e9b42300289514ff00a0094dacfedcc8aa49ddf389bee649b9b4e8b 0/0 0.005
	exporting manifest list sha256:6325cec76978445d731e446ca8db9e751b45938d2b899771ba68388f5519d962 0/0 0.002
	naming to moby-dangling@sha256:6325cec76978445d731e446ca8db9e751b45938d2b899771ba68388f5519d962 0/0 0.001
	unpacking to moby-dangling@sha256:6325cec76978445d731e446ca8db9e751b45938d2b899771ba68388f5519d962 0/0 2.367

the app in questions: https://hatchbytestudios-young-rain-9090.fly.dev(https://hatchbytestudios-young-rain-9090.fly.dev/

Thanks again

Hey!

here is the dockerfile that came with the template:

FROM node:20-alpine AS development-dependencies-env
COPY . /app
WORKDIR /app
RUN npm ci

FROM node:20-alpine AS production-dependencies-env
COPY ./package.json package-lock.json /app/
WORKDIR /app
RUN npm ci --omit=dev

FROM node:20-alpine AS build-env
COPY . /app/
COPY --from=development-dependencies-env /app/node_modules /app/node_modules
WORKDIR /app
RUN npm run build

FROM node:20-alpine
COPY ./package.json package-lock.json /app/
COPY --from=production-dependencies-env /app/node_modules /app/node_modules
COPY --from=build-env /app/build /app/build
WORKDIR /app
CMD ["npm", "run", "start"]

machine logs:

[internal] load build definition from Dockerfile
	transferring 723/0 0.003
[internal] load metadata for docker.io/library/node:20-alpine
[internal] load .dockerignore
[development-dependencies-env 1/4] FROM docker.io/library/node:20-alpine@sha256:c628bdc7ebc7f95b1b23249a445eb415ce68ae9def8b68364b35ee15e3065b0f
	resolve docker.io/library/node:20-alpine@sha256:c628bdc7ebc7f95b1b23249a445eb415ce68ae9def8b68364b35ee15e3065b0f 0/0 0.009
	sha256:a8c23aebbdc3af49dc775b14ff5448d1c781f6914c6b0fe3b25aeb9a47b81f75 444/444 0.088
	sha256:fe37ac954e5e4e10ba5e1d2ab0ee1e17e094c8a2674f93bdaecfd09d4d7e7d3d 1260603/1260603 0.191
	sha256:ea00b69f938d915f75eb18ab43debcf665e0cf852e9e1c169707e4b49746d26b 42630541/42630541 0.823
	sha256:6e771e15690e2fabf2332d3a3b744495411d6e0b00b2aea64419b58b0066cf81 3993029/3993029 0.496
	extracting 0/0 0.067
	extracting 0/0 0.587
	extracting 0/0 0.034
	extracting 0/0 0.014
[internal] load build context
	transferring 482402180/0 1.576
[development-dependencies-env 2/4] COPY . /app
[production-dependencies-env 2/4] COPY ./package.json package-lock.json /app/
[build-env 2/5] COPY . /app/
[production-dependencies-env 3/4] WORKDIR /app
[production-dependencies-env 4/4] RUN npm ci --omit=dev
	
	added 178 packages, and audited 179 packages in 5s
	
	33 packages are looking for funding
	run `npm fund` for details
	
	found 0 vulnerabilities
	npm notice
	npm notice New major version of npm available! 10.8.2 -> 11.3.0
	npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.3.0
	npm notice To update run: npm install -g npm@11.3.0
	npm notice
[development-dependencies-env 3/4] WORKDIR /app
[development-dependencies-env 4/4] RUN npm ci
	
	added 465 packages, and audited 466 packages in 7s
	
	63 packages are looking for funding
	run `npm fund` for details
	
	found 0 vulnerabilities
	npm notice
	npm notice New major version of npm available! 10.8.2 -> 11.3.0
	npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.3.0
	npm notice To update run: npm install -g npm@11.3.0
	npm notice
[stage-3 3/5] COPY --from=production-dependencies-env /app/node_modules /app/node_modules
[build-env 3/5] COPY --from=development-dependencies-env /app/node_modules /app/node_modules
[build-env 4/5] WORKDIR /app
[build-env 5/5] RUN npm run build
	
	> build
	> react-router build
	vite v6.3.4 building for production...
	transforming...
	βœ“ 860 modules transformed.
	rendering chunks...
	computing gzip size...
	build/client/.vite/manifest.json                  4.78 kB β”‚ gzip:  0.76 kB
	build/client/assets/logo-dark-pX2395Y0.svg        6.10 kB β”‚ gzip:  2.40 kB
	build/client/assets/logo-light-CVbx2LBR.svg       6.13 kB β”‚ gzip:  2.41 kB
	build/client/assets/home-DcyOTdnk.css             0.18 kB β”‚ gzip:  0.13 kB
	build/client/assets/listGrid-D6Fwm6md.css         1.37 kB β”‚ gzip:  0.55 kB
	build/client/assets/pricing-BZaf62Iq.css          1.41 kB β”‚ gzip:  0.60 kB
	build/client/assets/contactBanner-DbYsBRCU.css    1.95 kB β”‚ gzip:  0.69 kB
	build/client/assets/root-DK4w8i4q.css             2.53 kB β”‚ gzip:  0.82 kB
	build/client/assets/app-DsZuFtUt.css             10.49 kB β”‚ gzip:  3.02 kB
	build/client/assets/work-KCj3tkxs.js              0.50 kB β”‚ gzip:  0.35 kB
	build/client/assets/index-CY32Ck_D.js             0.83 kB β”‚ gzip:  0.52 kB
	build/client/assets/listGrid-sJRym8u1.js          1.32 kB β”‚ gzip:  0.52 kB
	build/client/assets/about-BAsYUHfM.js             2.04 kB β”‚ gzip:  0.94 kB
	build/client/assets/contactBanner-CGkT28y9.js     2.50 kB β”‚ gzip:  1.06 kB
	build/client/assets/services-Dq9E_l3R.js          2.75 kB β”‚ gzip:  1.41 kB
	build/client/assets/contact-rwmmH1RC.js           2.83 kB β”‚ gzip:  1.02 kB
	build/client/assets/pricing-Dul7wutk.js           3.76 kB β”‚ gzip:  1.79 kB
	build/client/assets/root-DtLgBHuk.js              4.88 kB β”‚ gzip:  1.84 kB
	build/client/assets/home-ZojLr9zZ.js              5.21 kB β”‚ gzip:  1.85 kB
	build/client/assets/link-CnLVys9_.js             41.94 kB β”‚ gzip: 13.05 kB
	build/client/assets/chunk-AYJ5UCUI-T-clhmxa.js  116.35 kB β”‚ gzip: 39.13 kB
	build/client/assets/entry.client-D0u6Ql6o.js    181.43 kB β”‚ gzip: 57.32 kB
	βœ“ built in 1.43s
	vite v6.3.4 building SSR bundle for production...
	transforming...
	"default" is imported from external module "react" but never used in "virtual:react-router/with-props", "app/routes/contact.tsx", "app/components/contactBanner/contactBanner.tsx", "app/components/listGrid/listGrid.tsx", "app/components/pageBanner/pageBanner.tsx", "app/components/button/button.tsx", "app/routes/home.tsx", "app/components/pricingCards/pricingCards.tsx", "app/navigation/navBar.tsx", "app/navigation/footer.tsx" and "app/root.tsx".
	"AcademicCapIcon" and "ChatBubbleLeftEllipsisIcon" are imported from external module "@heroicons/react/24/outline" but never used in "app/routes/home.tsx", "app/components/pricingCards/pricingCards.tsx" and "app/navigation/navBar.tsx".
	"motion" and "AnimatePresence" are imported from external module "framer-motion" but never used in "app/root.tsx".
	βœ“ 32 modules transformed.
	rendering chunks...
	build/server/.vite/manifest.json                0.52 kB
	build/server/assets/logo-dark-pX2395Y0.svg      6.10 kB
	build/server/assets/logo-light-CVbx2LBR.svg     6.13 kB
	build/server/assets/server-build-D3WUOOqw.css  17.92 kB
	build/server/index.js                          42.69 kB
	βœ“ built in 131ms
	npm notice
	npm notice New major version of npm available! 10.8.2 -> 11.3.0
	npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.3.0
	npm notice To update run: npm install -g npm@11.3.0
	npm notice
[stage-3 4/5] COPY --from=build-env /app/build /app/build
[stage-3 5/5] WORKDIR /app
exporting to image
	exporting layers 0/0 9.162
	exporting manifest sha256:aa4de4330e8fd75d5e27c12eaa0077d2b18188021e9b405686d57f5109cc44d8 0/0 0.004
	exporting config sha256:71357da592e8a71d0f74b6cc92d905b2406392cb371d3810d410265d82e76334 0/0 0.003
	exporting attestation manifest sha256:6e7b98711e9b42300289514ff00a0094dacfedcc8aa49ddf389bee649b9b4e8b 0/0 0.005
	exporting manifest list sha256:6325cec76978445d731e446ca8db9e751b45938d2b899771ba68388f5519d962 0/0 0.002
	naming to moby-dangling@sha256:6325cec76978445d731e446ca8db9e751b45938d2b899771ba68388f5519d962 0/0 0.001
	unpacking to moby-dangling@sha256:6325cec76978445d731e446ca8db9e751b45938d2b899771ba68388f5519d962 0/0 2.367

App is https://hatchbytestudios-young-rain-9090.fly.dev

also my fly logs:

2025-05-01T23:06:52Z app[2875747b359de8] atl [info]npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.3.0
2025-05-01T23:06:52Z app[2875747b359de8] atl [info]npm notice To update run: npm install -g npm@11.3.0
2025-05-01T23:06:52Z app[2875747b359de8] atl [info]npm notice
2025-05-01T23:06:52Z app[2875747b359de8] atl [info] INFO Main child exited normally with code: 1
2025-05-01T23:06:52Z app[2875747b359de8] atl [info] INFO Starting clean up.
2025-05-01T23:06:52Z app[2875747b359de8] atl [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
2025-05-01T23:06:52Z app[2875747b359de8] atl [info][   28.057370] reboot: Restarting system
2025-05-01T23:06:53Z runner[2875747b359de8] atl [info]machine has reached its max restart count of 10
2025-05-01T23:06:56Z app[d8dd761c1265d8] atl [info]2025-05-01T23:06:56.129628723 [01JT6JEH5YFTMERZHJV07DPPB1:main] Running Firecracker v1.7.0
2025-05-01T23:06:57Z app[d8dd761c1265d8] atl [info] INFO Starting init (commit: d15e62a13)...
2025-05-01T23:06:58Z app[d8dd761c1265d8] atl [info] INFO Preparing to run: `docker-entrypoint.sh npm run start` as root
2025-05-01T23:06:58Z app[d8dd761c1265d8] atl [info] INFO [fly api proxy] listening at /.fly/api
2025-05-01T23:06:58Z runner[d8dd761c1265d8] atl [info]Machine started in 2.876s
2025-05-01T23:07:02Z app[d8dd761c1265d8] atl [info]2025/05/01 23:07:02 INFO SSH listening listen_address=[fdaa:17:a8cd:a7b:2d6:9dc4:87aa:2]:22
2025-05-01T23:07:10Z app[d8dd761c1265d8] atl [info]> start
2025-05-01T23:07:10Z app[d8dd761c1265d8] atl [info]> react-router-serve ./build/server/index.js
2025-05-01T23:07:18Z app[d8dd761c1265d8] atl [info]Error: Cannot find package 'classnames' imported from /app/build/server/index.js
2025-05-01T23:07:18Z app[d8dd761c1265d8] atl [info]    at packageResolve (node:internal/modules/esm/resolve:873:9)
2025-05-01T23:07:18Z app[d8dd761c1265d8] atl [info]    at moduleResolve (node:internal/modules/esm/resolve:946:18)
2025-05-01T23:07:18Z app[d8dd761c1265d8] atl [info]    at defaultResolve (node:internal/modules/esm/resolve:1188:11)
2025-05-01T23:07:18Z app[d8dd761c1265d8] atl [info]    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:642:12)
2025-05-01T23:07:18Z app[d8dd761c1265d8] atl [info]    at ModuleLoader.#cachedDefaultResolve (node:internal/modules/esm/loader:591:25)
2025-05-01T23:07:18Z app[d8dd761c1265d8] atl [info]    at ModuleLoader.resolve (node:internal/modules/esm/loader:574:38)
2025-05-01T23:07:18Z app[d8dd761c1265d8] atl [info]    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:236:38)
2025-05-01T23:07:18Z app[d8dd761c1265d8] atl [info]    at ModuleJob._link (node:internal/modules/esm/module_job:130:49)
2025-05-01T23:07:18Z app[d8dd761c1265d8] atl [info]npm notice
2025-05-01T23:07:18Z app[d8dd761c1265d8] atl [info]npm notice New major version of npm available! 10.8.2 -> 11.3.0
2025-05-01T23:07:18Z app[d8dd761c1265d8] atl [info]npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.3.0
2025-05-01T23:07:18Z app[d8dd761c1265d8] atl [info]npm notice To update run: npm install -g npm@11.3.0
2025-05-01T23:07:18Z app[d8dd761c1265d8] atl [info]npm notice
2025-05-01T23:07:19Z app[d8dd761c1265d8] atl [info] INFO Main child exited normally with code: 1
2025-05-01T23:07:19Z app[d8dd761c1265d8] atl [info] INFO Starting clean up.
2025-05-01T23:07:20Z app[d8dd761c1265d8] atl [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
2025-05-01T23:07:20Z app[d8dd761c1265d8] atl [info][   23.869161] reboot: Restarting system
2025-05-01T23:07:20Z runner[d8dd761c1265d8] atl [info]machine has reached its max restart count of 10
2025-05-01T23:07:40Z proxy[2875747b359de8] atl [info]Starting machine
2025-05-01T23:07:40Z app[2875747b359de8] atl [info]2025-05-01T23:07:40.605430725 [01JT6JEH6AXV1SFSNTKATG1DET:main] Running Firecracker v1.7.0
2025-05-01T23:07:42Z app[2875747b359de8] atl [info] INFO Starting init (commit: d15e62a13)...
2025-05-01T23:07:43Z app[2875747b359de8] atl [info] INFO Preparing to run: `docker-entrypoint.sh npm run start` as root
2025-05-01T23:07:43Z app[2875747b359de8] atl [info] INFO [fly api proxy] listening at /.fly/api
2025-05-01T23:07:43Z runner[2875747b359de8] atl [info]Machine started in 2.635s
2025-05-01T23:07:43Z proxy[2875747b359de8] atl [info]machine started in 2.640027633s
2025-05-01T23:07:48Z app[2875747b359de8] atl [info]2025/05/01 23:07:48 INFO SSH listening listen_address=[fdaa:17:a8cd:a7b:1ea:2cb4:fe40:2]:22
2025-05-01T23:07:57Z app[2875747b359de8] atl [info]> start
2025-05-01T23:07:57Z app[2875747b359de8] atl [info]> react-router-serve ./build/server/index.js
2025-05-01T23:08:05Z app[2875747b359de8] atl [info]Error: Cannot find package 'classnames' imported from /app/build/server/index.js
2025-05-01T23:08:05Z app[2875747b359de8] atl [info]    at packageResolve (node:internal/modules/esm/resolve:873:9)
2025-05-01T23:08:05Z app[2875747b359de8] atl [info]    at moduleResolve (node:internal/modules/esm/resolve:946:18)
2025-05-01T23:08:05Z app[2875747b359de8] atl [info]    at defaultResolve (node:internal/modules/esm/resolve:1188:11)
2025-05-01T23:08:05Z app[2875747b359de8] atl [info]    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:642:12)
2025-05-01T23:08:05Z app[2875747b359de8] atl [info]    at ModuleLoader.#cachedDefaultResolve (node:internal/modules/esm/loader:591:25)
2025-05-01T23:08:05Z app[2875747b359de8] atl [info]    at ModuleLoader.resolve (node:internal/modules/esm/loader:574:38)
2025-05-01T23:08:05Z app[2875747b359de8] atl [info]    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:236:38)
2025-05-01T23:08:05Z app[2875747b359de8] atl [info]    at ModuleJob._link (node:internal/modules/esm/module_job:130:49)
2025-05-01T23:08:05Z app[2875747b359de8] atl [info]npm notice
2025-05-01T23:08:05Z app[2875747b359de8] atl [info]npm notice New major version of npm available! 10.8.2 -> 11.3.0
2025-05-01T23:08:05Z app[2875747b359de8] atl [info]npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.3.0
2025-05-01T23:08:05Z app[2875747b359de8] atl [info]npm notice To update run: npm install -g npm@11.3.0
2025-05-01T23:08:05Z app[2875747b359de8] atl [info]npm notice
2025-05-01T23:08:07Z app[2875747b359de8] atl [info] INFO Main child exited normally with code: 1
2025-05-01T23:08:07Z app[2875747b359de8] atl [info] INFO Starting clean up.
2025-05-01T23:08:07Z app[2875747b359de8] atl [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
2025-05-01T23:08:07Z app[2875747b359de8] atl [info][   26.394124] reboot: Restarting system
2025-05-01T23:08:07Z runner[2875747b359de8] atl [info]machine has reached its max restart count of 10
2025-05-01T23:10:19Z proxy[2875747b359de8] atl [info]Starting machine
2025-05-01T23:10:19Z app[2875747b359de8] atl [info]2025-05-01T23:10:19.097106857 [01JT6JEH6AXV1SFSNTKATG1DET:main] Running Firecracker v1.7.0
2025-05-01T23:10:20Z app[2875747b359de8] atl [info] INFO Starting init (commit: d15e62a13)...
2025-05-01T23:10:21Z app[2875747b359de8] atl [info] INFO Preparing to run: `docker-entrypoint.sh npm run start` as root
2025-05-01T23:10:21Z app[2875747b359de8] atl [info] INFO [fly api proxy] listening at /.fly/api
2025-05-01T23:10:22Z runner[2875747b359de8] atl [info]Machine started in 3.027s
2025-05-01T23:10:22Z proxy[2875747b359de8] atl [info]machine started in 3.030832175s
2025-05-01T23:10:27Z app[2875747b359de8] atl [info]2025/05/01 23:10:26 INFO SSH listening listen_address=[fdaa:17:a8cd:a7b:1ea:2cb4:fe40:2]:22
2025-05-01T23:10:39Z app[2875747b359de8] atl [info]> start
2025-05-01T23:10:39Z app[2875747b359de8] atl [info]> react-router-serve ./build/server/index.js
2025-05-01T23:10:47Z app[2875747b359de8] atl [info]Error: Cannot find package 'classnames' imported from /app/build/server/index.js
2025-05-01T23:10:47Z app[2875747b359de8] atl [info]    at packageResolve (node:internal/modules/esm/resolve:873:9)
2025-05-01T23:10:47Z app[2875747b359de8] atl [info]    at moduleResolve (node:internal/modules/esm/resolve:946:18)
2025-05-01T23:10:47Z app[2875747b359de8] atl [info]    at defaultResolve (node:internal/modules/esm/resolve:1188:11)
2025-05-01T23:10:47Z app[2875747b359de8] atl [info]    at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:642:12)
2025-05-01T23:10:47Z app[2875747b359de8] atl [info]    at ModuleLoader.#cachedDefaultResolve (node:internal/modules/esm/loader:591:25)
2025-05-01T23:10:47Z app[2875747b359de8] atl [info]    at ModuleLoader.resolve (node:internal/modules/esm/loader:574:38)
2025-05-01T23:10:47Z app[2875747b359de8] atl [info]    at ModuleLoader.getModuleJobForImport (node:internal/modules/esm/loader:236:38)
2025-05-01T23:10:47Z app[2875747b359de8] atl [info]    at ModuleJob._link (node:internal/modules/esm/module_job:130:49)
2025-05-01T23:10:47Z app[2875747b359de8] atl [info]npm notice
2025-05-01T23:10:47Z app[2875747b359de8] atl [info]npm notice New major version of npm available! 10.8.2 -> 11.3.0
2025-05-01T23:10:47Z app[2875747b359de8] atl [info]npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.3.0
2025-05-01T23:10:47Z app[2875747b359de8] atl [info]npm notice To update run: npm install -g npm@11.3.0
2025-05-01T23:10:47Z app[2875747b359de8] atl [info]npm notice
2025-05-01T23:10:47Z app[2875747b359de8] atl [info] INFO Main child exited normally with code: 1
2025-05-01T23:10:48Z app[2875747b359de8] atl [info] INFO Starting clean up.
2025-05-01T23:10:48Z app[2875747b359de8] atl [info] WARN could not unmount /rootfs: EINVAL: Invalid argument
2025-05-01T23:10:48Z app[2875747b359de8] atl [info][   29.020135] reboot: Restarting system
2025-05-01T23:10:48Z runner[2875747b359de8] atl [info]machine has reached its max restart count of 10
2025-05-01T23:14:29Z proxy[2875747b359de8] atl [info]Starting machine
2025-05-01T23:14:29Z app[2875747b359de8] atl [info]2025-05-01T23:14:29.612422553 [01JT6JEH6AXV1SFSNTKATG1DET:main] Running Firecracker v1.7.0
2025-05-01T23:14:31Z app[2875747b359de8] atl [info] INFO Starting init (commit: d15e62a13)...
2025-05-01T23:14:32Z app[2875747b359de8] atl [info] INFO Preparing to run: `docker-entrypoint.sh npm run start` as root
2025-05-01T23:14:32Z app[2875747b359de8] atl [info] INFO [fly api proxy] listening at /.fly/api
2025-05-01T23:14:32Z runner[2875747b359de8] atl [info]Machine started in 2.909s
2025-05-01T23:14:32Z proxy[2875747b359de8] atl [info]machine started in 2.913878843s

Dockerfile

FROM node:20-alpine AS development-dependencies-env
COPY . /app
WORKDIR /app
RUN npm ci

FROM node:20-alpine AS production-dependencies-env
COPY ./package.json package-lock.json /app/
WORKDIR /app
RUN npm ci --omit=dev

FROM node:20-alpine AS build-env
COPY . /app/
COPY --from=development-dependencies-env /app/node_modules /app/node_modules
WORKDIR /app
RUN npm run build

FROM node:20-alpine
COPY ./package.json package-lock.json /app/
COPY --from=production-dependencies-env /app/node_modules /app/node_modules
COPY --from=build-env /app/build /app/build
WORKDIR /app
CMD ["npm", "run", "start"]```

app is https://hatchbytestudios-young-rain-9090.fly.dev/

I am trying to follow the different pieces in your multi-stage build. In general it is best to create one image to run everywhere; if you create an image per environment then something that works in dev and test can fail in prod, defeating one of the best features of containerisation.

The error suggests to me that this would also fail if you were to build it in Docker locally. Do you have Docker installed on your dev machine, and could you try it?

Thanks for all of the feedback, I had to rewrite the dockerfile to better compile what i wanted, It works nows and i love it!

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.