Sveltekit Dockerfile

My sveltekit project requires node v20 so I created a dockerfile for it:
FROM node:20

ARG DATABASE_URL
ARG DIRECT_DATABASE_URL
ARG NEXTAUTH_SECRET
ARG NEXTAUTH_URL
ARG NEXT_PUBLIC_STRIPE_PUBLIC_KEY
ARG PUBLIC_PAYPAL_KEY
ARG PUBLIC_STRIPE_KEY
ARG SECRET_PAYPAL_KEY
ARG STRIPE_SECRET_KEY
ARG PORT
ENV PORT=${PORT}

COPY package.json .
COPY yarn.lock .

RUN yarn install

COPY . .

RUN yarn run prisma generate

RUN yarn build

EXPOSE ${PORT}

ENTRYPOINT ["node", "build"]
FROM node:20

ARG DATABASE_URL
ARG DIRECT_DATABASE_URL
ARG NEXTAUTH_SECRET
ARG NEXTAUTH_URL
ARG NEXT_PUBLIC_STRIPE_PUBLIC_KEY
ARG PUBLIC_PAYPAL_KEY
ARG PUBLIC_STRIPE_KEY
ARG SECRET_PAYPAL_KEY
ARG STRIPE_SECRET_KEY
ARG PORT
ENV PORT=${PORT}

COPY package.json .
COPY yarn.lock .

RUN yarn install

COPY . .

RUN yarn run prisma generate

RUN yarn build

EXPOSE ${PORT}

ENTRYPOINT ["node", "build"]
I tested on my local system and the dockerfile runs but on railway it says completed and there are no deply logs.
Solution:
do you have a build or start command set elsewhere like in the service settings, if so, remove them.
Jump to solution
22 Replies
Percy
Percy3w ago
Project ID: b820c80e-50e9-475a-85c6-89832fccdd8c
Mrxbox98
Mrxbox983w ago
b820c80e-50e9-475a-85c6-89832fccdd8c
Brody
Brody3w ago
remove the port stuff from the dockerfile
Mrxbox98
Mrxbox983w ago
All the port stuff? Even the expose?
Brody
Brody3w ago
it's not needed
Mrxbox98
Mrxbox983w ago
I tried that and same thing happens completed with no logs
Brody
Brody3w ago
what browser are you on? can you see logs from other services you've deployed
Mrxbox98
Mrxbox983w ago
Chrome, I can see logs of everything else
Brody
Brody3w ago
can you see build logs for this service?
Mrxbox98
Mrxbox983w ago
yeah
Solution
Brody
Brody3w ago
do you have a build or start command set elsewhere like in the service settings, if so, remove them.
Mrxbox98
Mrxbox983w ago
Yeah I had a custom start command I used previously that is still there. Should I remove it?
Brody
Brody3w ago
yes it would be overwriting the ENTRYPOINT could have unintended side effects
Mrxbox98
Mrxbox983w ago
same issue
No description
Brody
Brody3w ago
are you able to share the repo? im not sure if i could be of further help if im not able to reproduce this
Mrxbox98
Mrxbox983w ago
Sure, whats your gh username?
Brody
Brody3w ago
brody192
Mrxbox98
Mrxbox983w ago
Added I can also share the railway project if that would help
Brody
Brody3w ago
maybe but we will hold off on that for right now
Mrxbox98
Mrxbox983w ago
Oh wait im so stupid :facepalm: i removed the custom build command but not the custom start one it works now ty for the help
Brody
Brody3w ago
well at least i was right haha
Brody
Brody3w ago
please dont close posts