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
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?
a year ago
are you sure you are using https when calling the railway domain?
a year ago
dont run uvicorn with a file watcher
a year ago
yes, you also need to call the api with https
a year ago
CMD uvicorn src.main:app --host 0.0.0.0 --port $PORT
a year ago
are you using https when calling the api?
```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
a year ago
no, theres nothing wrong with the container, this is a code issue
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 -
a year ago
is data.railway.interal in the same project?
a year ago
show me how you have implemented the sleep
# 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
a year ago
not with uvicorn you cant, you would need to use hypercorn for that
hypercorn src.main:app --bind [::]:$PORT
I noticed when I use extneral address it moved 8000 to port regular https port.
# 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
```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)```
a year ago
as previously mentioned, you would need to use hypercorn, you would also need to specify the port in the url
a year ago
you would need to install hypercorn