Having issues connecting to my docker file, also need help on how to trouble shoot the instance.

kingassunePRO

a year ago

I'm creating and API, that should be hosted on port 8000. Having issue trouble shooting the railway instance, and connecting to the API.

0 Replies

a year ago

Please state what issues you are running into


a year ago

n/a


kingassunePRO

a year ago

The API is not responding, and I want to check the container to know that everything is working correctly


a year ago

The API is not responding
going to need more specifics than that

are there any errors in the deployment logs?


kingassunePRO

a year ago

I'm getting 405 errors


a year ago

are you sure you are using https when calling the railway domain?


kingassunePRO

a year ago

1226984948032864500


kingassunePRO

a year ago

I think I'm calling https


kingassunePRO

a year ago

http


a year ago

dont run uvicorn with a file watcher


kingassunePRO

a year ago

I need to take that off


a year ago

yes, you also need to call the api with https


kingassunePRO

a year ago

CMD ["sh", "-c", "uvicorn src.main:app --reload --host 0.0.0.0 --port 8000"]


kingassunePRO

a year ago

what turns off the file watcher


a year ago

CMD uvicorn src.main:app --host 0.0.0.0 --port $PORT

kingassunePRO

a year ago

1226988015856128000


kingassunePRO

a year ago

1226988116917883000


a year ago

are you using https when calling the api?


kingassunePRO

a year ago

I'm using https now it didn't go this far before


kingassunePRO

a year ago

so it fixed a little of my issue.


kingassunePRO

a year ago

```FROM mcr.microsoft.com/vscode/devcontainers/python:3.10

RUN addgroup app && adduser -S -G app app -h /home/app

set the user to run the app

USER app

#
WORKDIR /app
COPY requirements.txt requirements.txt
RUN pip install --upgrade pip
RUN pip install --no-cache-dir -r requirements.txt
COPY . /app
CMD uvicorn src.main:app --host 0.0.0.0 --port $PORT
EXPOSE 8000```


a year ago

please use https everywhere you make an api call


kingassunePRO

a year ago

is there any way to get into the container to trouble shoot.


a year ago

no, theres nothing wrong with the container, this is a code issue


kingassunePRO

a year ago

I have one more question when I try to use the interal DNS it's not connecting to it?


a year ago

please read this -


kingassunePRO

a year ago

I added the sleep function still getting it

1226995483315015700


a year ago

is data.railway.interal in the same project?


kingassunePRO

a year ago

Yes


a year ago

show me how you have implemented the sleep


kingassunePRO

a year ago

1226999651723382800


kingassunePRO

a year ago

# USER app # WORKDIR /app COPY requirements.txt requirements.txt RUN pip install --upgrade pip RUN pip install --no-cache-dir -r requirements.txt COPY . /app CMD sleep 3 && uvicorn src.main:app --host 0.0.0.0 --port $PORT EXPOSE 8000


kingassunePRO

a year ago

Can you have private and open network going at the same time?


kingassunePRO

a year ago

when I to private network does it go to the correct port?


a year ago

not with uvicorn you cant, you would need to use hypercorn for that

hypercorn src.main:app --bind [::]:$PORT

kingassunePRO

a year ago

I noticed when I use extneral address it moved 8000 to port regular https port.


kingassunePRO

a year ago

# WORKDIR /app COPY requirements.txt requirements.txt RUN pip install --upgrade pip RUN pip install --no-cache-dir -r requirements.txt COPY . /app CMD sleep 3 && uvicorn src.main:app --host 0.0.0.0 --port $PORT EXPOSE 8000


kingassunePRO

a year ago

```1 of 1 unhandled error
Next.js (14.1.2) out of date (learn more)

Unhandled Runtime Error
Error: connect ECONNREFUSED fd12:f569:4236::52:35e4:250b:443

Source
thirdwebAuth.ts (20:29) @ async Object.onUser

18 | last_active: new Date().toISOString(),
19 | }

20 | const data = await axios.post(${process.env.BACKEND_URL}/users, payload);
| ^
21 | return data.data
22 | }
23 | },
Call Stack
async BuildPage
app/build/page.tsx (5:15)```


kingassunePRO

a year ago

Getting this error when I try to connet to the internal network


a year ago

as previously mentioned, you would need to use hypercorn, you would also need to specify the port in the url


kingassunePRO

a year ago

1227015342069387300


a year ago

you would need to install hypercorn


Having issues connecting to my docker file, also need help on how to trouble shoot the instance. - Railway Help Station