Container failed to start

gitagogamingTRIAL

9 months 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

gitagogamingTRIAL

9 months ago

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


gitagogamingTRIAL

9 months ago

1276782792746729500


gitagogamingTRIAL

9 months 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;"]

9 months ago

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


gitagogamingTRIAL

9 months ago

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

1276786670133579887


gitagogamingTRIAL

9 months ago

well that didnt work


gitagogamingTRIAL

9 months ago

is there no copy log/download log option? 😐


9 months 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?


9 months ago

ctrl / cmd + k -> search logs


gitagogamingTRIAL

9 months ago

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

1276905661053276400


9 months ago

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


9 months ago

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


9 months ago

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


gitagogamingTRIAL

9 months ago

yes, react-scripts start


9 months ago

remove it


gitagogamingTRIAL

9 months ago

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


9 months ago

remove them


gitagogamingTRIAL

9 months ago

got it


gitagogamingTRIAL

9 months 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


9 months ago

railway isn't a VPS host 🙂


gitagogamingTRIAL

9 months ago

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


gitagogamingTRIAL

9 months ago

go ahead


9 months ago

hahaha


gitagogamingTRIAL

9 months ago

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


gitagogamingTRIAL

9 months ago

thanks for the great platform


9 months ago

I'm just the support guy, but thank you


gitagogamingTRIAL

9 months ago

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


gitagogamingTRIAL

9 months ago

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


9 months ago

ouuu software, support sounds fun


Container failed to start - Railway Help Station