9 months ago
SDK 9.0. It works with a mysql database and a angular frontend
42 Replies
9 months ago
hey, can you be more specific on what does not deploy? Did you try it?
9 months ago
extra info:
his repo https://github.com/Melvineitor/FinalDestination
9 months ago
he's trying to deploy an api inside /inmo/api
9 months ago
it's all ai generated
9 months 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.
9 months 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?
9 months ago
make sure to set the following environment variables on your Railway service:
ASPNETCORE_URLS=http://0.0.0.0:8080
PORT=80809 months ago
Nixpacks is not detecting that you're using a Dockerfile, in the Railway dashboard did you set a root directory?
9 months 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
9 months ago
Oh, then use the full path. Railway does not take into account the root directory that you set earlier.
9 months ago
What do you mean?
9 months ago
what error does it give? paste full build logs
9 months ago
are you sure you did change the Dockerfile? seems like it's using the old one
9 months ago
change this one, not the root one
9 months ago
so everything's working?
everything is running, yes
not necessarily working
still gotta fix the enrouting
9 months ago
(he deployed it successfully, we talked in dms)
9 months ago
!s
Status changed to Solved medim • 9 months ago
Status changed to Solved medim • 9 months ago
9 months ago
hmm…
9 months ago
!s
9 months ago
dammit