8 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.
23 Replies
8 months ago
Howdy! By any chance are you able to share your full Dockerfile?
offcourse
8 months ago
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 ASPNETCORE_URLS="http://+:8080"
ENV DOTNET_SYSTEM_NET_HTTP_USESOCKETSHTTPHANDLER=0
ENTRYPOINT ["dotnet", "CrowdinExtractorWebhook.Api.dll"]```
8 months ago
The error comes down to the builder not being able to find CrowdinExtractorWebhook.Api/CrowdinExtractorWebhook.Api.csproj
8 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.
7 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.

7 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 -20
7 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.
7 months ago
Interesting 🧐
Project successfully deployed https://crowdinextractorwebhook-production.up.railway.app/health
7 months ago
Glad you got this to work!
7 months ago
Happy days. Glad all is well! Feel free to reach out again if you need anything.
7 months ago
!s
Status changed to Solved noahd • 8 months ago

