#How to vew a FrontEnd React App deployed on Railway

26 messages · Page 1 of 1 (latest)

cursive moss
#

I deployed a doeckerized React app, generated it's domain, connected it to an similar image on Dockerhub. But I keep getting 'Application failed to respond'
the project ID is 9bf1df8d-fa05-4e4c-ba99-360b9f4688b0

thin kilnBOT
#

Project ID: 9bf1df8d-fa05-4e4c-ba99-360b9f4688b0

bronze chasmBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

cursive moss
#

thank you @steady minnow, I'll read it

steady minnow
#

friendly reminder, please no pings
#🛂|readme #5

cursive moss
#

I want to deploy a react app but it is contenerized with Docker

steady minnow
#

yes that is how railway works

#

what seems to be the problem?

cursive moss
#

that I think that 'Getting Your Create-React-App Running on Railway' is for non docker apps

steady minnow
#

I wrote that specifically for getting your app running on railway, the presence of docker is irrelevant in this situation, please follow the guide

cursive moss
#

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.

steady minnow
#

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

cursive moss
#

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

steady minnow
#

use serve like the guide suggested

cursive moss
#

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

steady minnow
cursive moss
#

ok

cursive moss
#

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?

steady minnow
#

Could you tell me what am i doing wrong?
not reading my guide closely enough
more specifically? not using $PORT in your dockerfile
you dont need a dockerfile in this instance, please delete it

cursive moss
#

ok, I am deploying it without the Dockerfile

#

but, what do I do: railway up?