Deployment Issues with Frontend on Railway

jcbehoTRIAL

a year ago

I am having trouble deploying my frontend application on Railway. The image build is done correctly, but the container repeatedly restarts and stops. Here are the details of the build and deployment logs:

15 exporting to image

15 exporting layers done

15 writing image sha256:053de492645478dd5b8a31179a07205854ade484c528b80317b17d7faf3ae527 done

15 naming to [us-west1.registry.rlwy.net/f3efe43e-bb4e-4483-8eeb-c8cc8fcb52b7](us-west1.registry.rlwy.net/f3efe43e-bb4e-4483-8eeb-c8cc8fcb52b7):40fc0256-7482-4d4d-b37e-7c397fda73f3 done

15 DONE 0.0s

=== Successfully Built! ===

Run:
docker run -it [us-west1.registry.rlwy.net/f3efe43e-bb4e-4483-8eeb-c8cc8fcb52b7](us-west1.registry.rlwy.net/f3efe43e-bb4e-4483-8eeb-c8cc8fcb52b7):40fc0256-7482-4d4d-b37e-7c397fda73f3

Build time: 0.69 seconds

Publishing Image

The push refers to repository [us-west1.registry.rlwy.net/f3efe43e-bb4e-4483-8eeb-c8cc8fcb52b7]

Preparing fdc947eaa51f
Preparing 18f65439fe97
Preparing afcf12fc12fe
Preparing fdc947eaa51f
Preparing a23c867ff03c
Preparing fdc947eaa51f
Preparing d6296119c575
Preparing 19372a0280ff
Preparing 788f8f2bcdc3
Preparing 731331b66c4f
Preparing f38050e5c7c8
Preparing 629ca62fb7c7
Waiting 19372a0280ff
Waiting 788f8f2bcdc3
Waiting 731331b66c4f
Waiting f38050e5c7c8
Waiting 629ca62fb7c7
Layer already exists 18f65439fe97
Layer already exists a23c867ff03c
Layer already exists fdc947eaa51f
Layer already exists afcf12fc12fe
Layer already exists d6296119c575
Layer already exists 788f8f2bcdc3
Layer already exists 19372a0280ff
Layer already exists 731331b66c4f
Layer already exists f38050e5c7c8
Layer already exists 629ca62fb7c7
40fc0256-7482-4d4d-b37e-7c397fda73f3: digest: sha256:8560a01aa89832b36e4995e411e57db241f794999a6b5ee4b27ac4d54ebff128 size: 2839

Publish time: 1.38 seconds

Deployment has crashed
Killed
container event container died
container event container restart
npm

WARN config production Use --omit=dev instead.

client@0.0.0 build-memory

npm
WARN

config

production Use --omit=dev instead.

vite v5.2.12 building for production…

transforming…

✓ 1758 modules transformed.

Killed
container event container restart

Start Command: npm run build-memory

package.json:
"scripts": {
"dev": "vite",
"build": "vite build",
"serve": "vite preview",
"lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"build-memory": "cross-env NODE_OPTIONS='--max-old-space-size=4096' npm run build"
},

View Deploy details

ⓘ Deployment information is only viewable by project members and Railway employees.

1 Replies

a year ago

You are trying to run a very resource intensive development server.Instead you need to run a web server.Here is an example repo for vite and react -https://github.com/brody192/vite-react-templateYou may not be using react but that doesnt matter since you are using vite.Copy the nixpacks.toml and Caddyfile from that repo into yours.If you have any build or start commands set in the service settings please remove them.