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
# 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
not seeing any obvious way to download it, so heres a copy paste.
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
checked several screens when presing ctrl+k and none of them came up with anything to do with copying/downloading the logs
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?
9 months ago
remove it
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
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 🙂
9 months ago
hahaha
… you dont need to explain.. just know im clueless but ill figure it out.. i always do 🙂
9 months ago
I'm just the support guy, but thank you
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