a year ago
SDK 9.0. It works with a mysql database and a angular frontend
42 Replies
a year ago
hey, can you be more specific on what does not deploy? Did you try it?
a year ago
extra info:
a year ago
he's trying to deploy an api inside /inmo/api
a year ago
it's all ai generated
a year ago
@AkuaFR
i have a project using angular as frontend and an asp.net api as a backend
im trying to make a hosting for the app in, and the frontend loads just fine
but the backend has given me a lot of trouble
im trying with a docker file, but it is not working
right know, it shows me this
"dotnet restore" did not complete successfully: exit code: 1
MSBUILD : error MSB1003: Specify a project or solution file. The current working directory does not contain a project or solution file.
a year ago
FROM mcr.microsoft.com/dotnet/sdk:9.0 AS build
WORKDIR /src
# Copy csproj and restore dependencies
COPY ["api.csproj", "./"]
RUN dotnet restore
# Copy the rest of the code
COPY . .
RUN dotnet build "api.csproj" -c Release -o /app/build
RUN dotnet publish "api.csproj" -c Release -o /app/publish /p:UseAppHost=false
# Final stage/image
FROM mcr.microsoft.com/dotnet/aspnet:9.0
WORKDIR /app
COPY --from=build /app/publish .
ENTRYPOINT ["dotnet", "api.dll"]can you try the dockerfile above?
a year ago
make sure to set the following environment variables on your Railway service:
ASPNETCORE_URLS=http://0.0.0.0:8080
PORT=8080a year ago
Nixpacks is not detecting that you're using a Dockerfile, in the Railway dashboard did you set a root directory?
a year ago
Ok, then tell Railway to use it, add a RAILWAY_DOCKERFILE_PATH=Dockerfile environment variable to your service. If it fails to encounter that path, try to use the full path RAILWAY_DOCKERFILE_PATH=/inmo/api/Dockerfile
it loaded
but it loaded the frontend instead of the backend
even tho it detected the docker file
a year ago
Oh, then use the full path. Railway does not take into account the root directory that you set earlier.
a year ago
What do you mean?
a year ago
what error does it give? paste full build logs
a year ago
are you sure you did change the Dockerfile? seems like it's using the old one
a year ago
change this one, not the root one
a year ago
so everything's working?
everything is running, yes
not necessarily working
still gotta fix the enrouting
a year ago
(he deployed it successfully, we talked in dms)
a year ago
!s
Status changed to Solved medim • 12 months ago
a year ago
hmm...
a year ago
!s
a year ago
dammit