Container failed to start
gitagogaming
FREEOP

2 years 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..

29 Replies

gitagogaming
FREEOP

2 years ago

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


gitagogaming
FREEOP

2 years ago

1276782792746729500


gitagogaming
FREEOP

2 years 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;"]

2 years ago

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


gitagogaming
FREEOP

2 years ago

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

1276786670133579887


gitagogaming
FREEOP

2 years ago

well that didnt work


gitagogaming
FREEOP

2 years ago

is there no copy log/download log option? 😐


2 years 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?


2 years ago

ctrl / cmd + k -> search logs


gitagogaming
FREEOP

2 years ago

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

1276905661053276400


2 years ago

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


2 years ago

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


2 years ago

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


gitagogaming
FREEOP

2 years ago

yes, react-scripts start


2 years ago

remove it


gitagogaming
FREEOP

2 years ago

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


2 years ago

remove them


gitagogaming
FREEOP

2 years ago

got it


gitagogaming
FREEOP

2 years 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


2 years ago

railway isn't a VPS host 🙂


gitagogaming
FREEOP

2 years ago

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


gitagogaming
FREEOP

2 years ago

go ahead


2 years ago

hahaha


gitagogaming
FREEOP

2 years ago

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


gitagogaming
FREEOP

2 years ago

thanks for the great platform


2 years ago

I'm just the support guy, but thank you


gitagogaming
FREEOP

2 years ago

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


gitagogaming
FREEOP

2 years ago

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


2 years ago

ouuu software, support sounds fun


Loading...