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
Percy6mo ago
Project ID: b820c80e-50e9-475a-85c6-89832fccdd8c
Mrxbox98
Mrxbox98OP6mo ago
b820c80e-50e9-475a-85c6-89832fccdd8c
Brody
Brody6mo ago
remove the port stuff from the dockerfile
Mrxbox98
Mrxbox98OP6mo ago
All the port stuff? Even the expose?
Brody
Brody6mo ago
it's not needed
Mrxbox98
Mrxbox98OP6mo ago
I tried that and same thing happens completed with no logs
Brody
Brody6mo ago
what browser are you on? can you see logs from other services you've deployed
Mrxbox98
Mrxbox98OP6mo ago
Chrome, I can see logs of everything else
Brody
Brody6mo ago
can you see build logs for this service?
Mrxbox98
Mrxbox98OP6mo ago
yeah
Solution
Brody
Brody6mo ago
do you have a build or start command set elsewhere like in the service settings, if so, remove them.
Mrxbox98
Mrxbox98OP6mo ago
Yeah I had a custom start command I used previously that is still there. Should I remove it?
Brody
Brody6mo ago
yes it would be overwriting the ENTRYPOINT could have unintended side effects
Mrxbox98
Mrxbox98OP6mo ago
same issue
No description
Brody
Brody6mo 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
Mrxbox98OP6mo ago
Sure, whats your gh username?
Brody
Brody6mo ago
brody192
Mrxbox98
Mrxbox98OP6mo ago
Added I can also share the railway project if that would help
Brody
Brody6mo ago
maybe but we will hold off on that for right now
Mrxbox98
Mrxbox98OP6mo 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
Brody6mo ago
well at least i was right haha
Brody
Brody6mo ago
please dont close posts
Want results from more Discord servers?
Add your server