2 months ago
When I try to deploy using this Dockerfile, I get this error, but running the same Dockerfile locally works normally.
PS: I have performed other deployments using Dockerfile on Railway and did not encounter this same error.
0 Replies
2 months ago
Howdy!
By any chance are you able to share your full Dockerfile?
offcourse
2 months ago
```Dockerfile
FROM mcr.microsoft.com/dotnet/aspnet:8.0 AS base
USER $APP_UID
WORKDIR /app
EXPOSE 8080
EXPOSE 8081
Estágio de build
FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build
WORKDIR /src
COPY ["CrowdinExtractorWebhook.Api/CrowdinExtractorWebhook.Api.csproj", "CrowdinExtractorWebhook.Api/"]
Restaurar as dependências
RUN dotnet restore "CrowdinExtractorWebhook.Api/CrowdinExtractorWebhook.Api.csproj"
Copiar o resto do código-fonte
COPY . .
Build da aplicação
WORKDIR "/src/CrowdinExtractorWebhook.Api"
RUN dotnet build "CrowdinExtractorWebhook.Api.csproj" -c Release -o /app/build
Estágio de publicação
FROM build AS publish
RUN dotnet publish "CrowdinExtractorWebhook.Api.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
Copiar os arquivos publicados
COPY --from=publish /app/publish .
ENV ASPNETCOREURLS="http://+:8080" ENV DOTNETSYSTEMNETHTTP_USESOCKETSHTTPHANDLER=0
ENTRYPOINT ["dotnet", "CrowdinExtractorWebhook.Api.dll"]```
2 months ago
The error comes down to the builder not being able to find CrowdinExtractorWebhook.Api/CrowdinExtractorWebhook.Api.csproj
2 months ago
Can you make sure that path is right?
The second image I sent when opening this thread shows that the build runs, so I'm almost certain.
2 months ago
I used your same Dockerfile on this simple repo,
https://github.com/crisog/railway-deploy/tree/dotnet
And it got deployed correctly here,
https://dotnet-production-005d.up.railway.app/weatherforecast
Can you show us your Click the service -> Settings -> Source?
For the sample repo, I have it default / (see image attached)
Maybe you have something different there, if not, maybe it needs to be different depending on where your Dockerfile is located in your repository.

2 months ago
If you are on Mac/Linux, run this in your project directory. That'd be very helpful to see if we can figure this out <:salute:1137099685417451530>
find . -name "Dockerfile" -o -name "CrowdinExtractorWebhook.Api" -type d | head -202 months ago
Could you run this command in your repository root?
I am using Windows, not Linux, but the folder reading structure is the same as I use in other projects and should not vary in this one.

This is the tree of essential files used:
E:.
│ CrowdinExtractorWebhook.sln
│ Dockerfile
│
└───CrowdinExtractorWebhook.Api
│ CrowdinExtractorWebhook.Api.csproj
I identified the error: For some reason, when the project was executed on the railway, it changed the name from Api to API, and since Linux is case sensitive, it gave the error.
2 months ago
Interesting 🧐
Project successfully deployed https://crowdinextractorwebhook-production.up.railway.app/health
2 months ago
Glad you got this to work!
2 months ago
Happy days. Glad all is well! Feel free to reach out again if you need anything.
2 months ago
!s
Status changed to Solved noahd • about 2 months ago

