#How to vew a FrontEnd React App deployed on Railway
26 messages · Page 1 of 1 (latest)
Project ID: 9bf1df8d-fa05-4e4c-ba99-360b9f4688b0
thank you @steady minnow, I'll read it
friendly reminder, please no pings
#🛂|readme #5
I want to deploy a react app but it is contenerized with Docker
that I think that 'Getting Your Create-React-App Running on Railway' is for non docker apps
I wrote that specifically for getting your app running on railway, the presence of docker is irrelevant in this situation, please follow the guide
ok
but I'm using the build of the app, the app is already written, and I also use nginx, as the server, instead of the default server.
okay so you've already got a far more complex app than the default create react app is
please share your repo so I can advise further
I'm trying to get rid of nginx, it is not working as it should, I'm going back to the use of the node default server, I'll let you know when I'm done
use serve like the guide suggested
I used server, when deploying it, the logs are succesfull, the deploy logs in the Railway page, say 'INFO Accepting connections at http://localhost:3000'. the build logs don't mention any error, but the Details say 'Dockerfile on failure'. when I go to the address 'menufrontapp-production-788f.up.railway.app', it says 'Application failed to respond'
the id Project ID is: 7d716c40-ff21-44d0-8eb7-8bfb69c8c7e3
serve*, I used serve
then please please just read the guide
ok
I keep getting an error: This is my Dockerfile.
# Use the node:alpine base image
FROM node:alpine
# Set the working directory inside the container
WORKDIR /app
# Copy package.json and package-lock.json to the container
COPY package.json package-lock.json ./
# Install dependencies
RUN npm ci
# Copy the rest of the web directory to the container
COPY . .
# Install 'serve' globally (for production)
RUN npm install -g serve
# Expose port 3000 for the web server
EXPOSE 3000
# Serve the built application using 'serve' with the specified options
CMD ["serve", "build", "-s", "-n", "-l", "3000"]
my package.json scripts is:
"scripts": {
"start": "serve build -s -n -L -p ${PORT:-3000}",
"build": "react-scripts build",
"serve": "react-scripts start"
},
Could you tell me what am i doing wrong?
Could you tell me what am i doing wrong?
not reading my guide closely enough
more specifically? not using$PORTin your dockerfile
you dont need a dockerfile in this instance, please delete it