Container failed to start

gitagogaming
FREE

a year ago

I am trying to deploy and when railway is doing the build it seems to "complete" without errors, but the container fails to start and I am unsure why..
I have tried a few things I found online like setting up a dockerFile, nginx.conf and testing a local build..

Building it locally everything seems to run fine with no issues, but when building via railway it seems to fail at the end..

0 Replies

gitagogaming
FREE

a year ago

4192a00e-89d7-4e81-be01-005041c8e063


gitagogaming
FREE

a year ago

1276782792746729500


gitagogaming
FREE

a year ago

# Use an official Node.js runtime as a parent image
FROM node:20 as build

# Set the working directory
WORKDIR /app

# Copy package.json and package-lock.json
COPY package*.json ./

# Install dependencies
RUN npm install

# Copy the rest of the application code
COPY . .

# Specify the environment variable
ARG ACCESS_TOKEN
ENV ACCESS_TOKEN=$ACCESS_TOKEN

# Build the application
RUN npm run build

# Use an official Nginx image to serve the build
FROM nginx:alpine

# Remove the default Nginx configuration file
RUN rm /etc/nginx/conf.d/default.conf

# Copy the build output to the Nginx html directory
COPY --from=build /app/build /usr/share/nginx/html

# Copy custom Nginx configuration
COPY nginx.conf /etc/nginx/conf.d/default.conf

# Expose port 80
EXPOSE 80

# Start Nginx
CMD ["nginx", "-g", "daemon off;"]

a year ago

Please download and send your whole log file, not just the failed to start error


gitagogaming
FREE

a year ago

not seeing any obvious way to download it, so heres a copy paste.

1276786670133579887


gitagogaming
FREE

a year ago

well that didnt work


gitagogaming
FREE

a year ago

is there no copy log/download log option? 😐


a year ago

From experience, the full build logs will not provide any more information, as the build itself has succeeded. maybe they have an incorrect start command set in the service settings?


a year ago

ctrl / cmd + k -> search logs


gitagogaming
FREE

a year ago

checked several screens when presing ctrl+k and none of them came up with anything to do with copying/downloading the logs

1276905661053276400


a year ago

it's somewhere, maybe that's the wrong search term


a year ago

either way, logs won't help here, your build did succeed


a year ago

do you have a start command set in the service settings?


gitagogaming
FREE

a year ago

yes, react-scripts start


a year ago

remove it


gitagogaming
FREE

a year ago

o wait thats the package.json im sorry.. but inside of the actual settings i do have a customs tartup cvommand too


a year ago

remove them


gitagogaming
FREE

a year ago

got it


gitagogaming
FREE

a year ago

well then.. that seemed to do it.. Appreciate your help very much..

This is my first time ever using a docker, also a VPS host… 😛 went pretty smooth overall


a year ago

railway isn't a VPS host 🙂


gitagogaming
FREE

a year ago

tell me im a noob, without telling me im a noob


gitagogaming
FREE

a year ago

go ahead


a year ago

hahaha


gitagogaming
FREE

a year ago

… you dont need to explain.. just know im clueless but ill figure it out.. i always do 🙂


gitagogaming
FREE

a year ago

thanks for the great platform


a year ago

I'm just the support guy, but thank you


gitagogaming
FREE

a year ago

without you, i'd be lost.. soo thanks goes to you still 🙂


gitagogaming
FREE

a year ago

I do support on another discord for a piece of software so I know what its like 😛


a year ago

ouuu software, support sounds fun


Container failed to start - Railway Help Station