Change app.config by bash in linux container

Hello. I try to change value in below line in file app.config in Linux container.
<add key="dmtUrl" value="{{API_ENDPOINT}}" /
I created bash script and put in ENTRYPOINT in docker-compose:
Bash script(entrypoint.sh):

#!/bin/sh
set -e
for i in ./app.config; do
    sed -i "s|{{API_ENDPOINT}}|$API_ENDPOINT|" "$i"
done
exec "$@"

Dockerfile:

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1-buster-slim AS base

WORKDIR /app
EXPOSE 44399 443
FROM mcr.microsoft.com/dotnet/core/sdk:3.1-buster AS build
WORKDIR /src
COPY ["Project1.Api/Project1.Api.csproj", "Project1.Api/"]
COPY ["Project2.Test/Project2.Test.csproj", "Project1.Test/"]
RUN dotnet restore "Project1.Api/Project1.Api.csproj"
COPY . .
WORKDIR "/src/Project1.Api"
RUN dotnet build "Project1.Api.csproj" -c Release -o /app/build
FROM build AS publish
RUN dotnet publish "Project1.Api.csproj" -c Release -o /app/publish
FROM base AS final
WORKDIR /app
ENV ASPNETCORE_URLS http://*:44399
COPY --from=publish /app/publish .
ENTRYPOINT ["/bin/bash", "./entrypoint.sh"]
CMD ["dotnet", "Project1.Api.dll"]

Docker-compose:

services:
  mse_api_service:
    image: mse_api
    environment:
      - DMT_ENDPOINT=http://dbm_service:3000/api/v1/

I run bash script in windows and it change API_ENDPOINT correctly, but on my Linux container in does not work. Any idea what am I doing wrong?