Devcontainer leave terminal process running

I have a docker-compose stack running on a remote server with 5 services. On the server, the file structure looks like this:

.
├── devcontainers
│   ├── AssetCompiler
│   │   └── .devcontainer
│   │       ├── devcontainer.json
│   │       └── setup.sh
│   ├── DocumentStore
│   │   └── .devcontainer
│   │       ├── devcontainer.json
│   │       └── setup.sh
│   └── docker-compose.devcontainer.yml
├── docker-compose.override.yml
└── docker-compose.yml

To develop the application remotely, I connect to the remote sever in VS Code (using Remote-SSH), enter one of the devcontainer root folders (for instance devcontainers/DocumentStore) and execute Dev Containers: Reopen in Container from the VS Code Command Palette.
Both devcontainers use the same docker image which is based on the Microsoft dotnet devcontainer image.

#
# Use the devcontainer SDK as a basis
#
FROM mcr.microsoft.com/devcontainers/dotnet

# - Install additional packages
RUN apt-get update && 
    apt-get install --no-install-recommends -y 
        dumb-init 
        npm 
        ssh && 
    apt-get clean

WORKDIR /app

# - Expose the webserver port that we will be using to access the application
EXPOSE 4812 4813

# - Opt out of the MS telemetry function
ENV DOTNET_CLI_TELEMETRY_OPTOUT=1

# - Use the polling file watcher
ENV DOTNET_USE_POLLING_FILE_WATCHER=true

ENTRYPOINT ["sleep", "infinity"]

The devcontainer.json looks like this:

{
    "name": "DocumentStore",

    "dockerComposeFile": [
        "../../../docker-compose.yml",
        "../../../docker-compose.override.yml",
        "../../docker-compose.devcontainer.yml"
    ],
    "service": "documentstore",

    "overrideCommand": false,
    
    "workspaceFolder": "/workspace",

    "customizations": {
        "vscode": {
            "settings": {},
            "extensions": [
                "ms-dotnettools.csharp",
                "ms-dotnettools.csdevkit",
                "augustocdias.tasks-shell-input"
            ]
        }
    },
    "shutdownAction": "none",

    "postCreateCommand": ["/.devcontainer/setup.sh"],

    "remoteUser": "1000"
}

The setup.sh script clones the source code if it does not exist and should only run when the container is spinning up for the first time. Like this:

#!/bin/bash

rootpathos="/workspace"

if [ ! -d "$rootpathos/.git" ]; then

    cd "$rootpathos"

    echo "=> Cloning the repository <="


    cd "$rootpathos"

    git clone --recurse-submodules ssh://<<path to repro>> .
    git submodule update --init --recursive
    git submodule update --recursive

    echo "=> Done cloning repository <="

    echo "=> Setting up additional components <="

    npm install

    echo "=> Done setting up additional components <="
else
    echo "=> All has been setup already <="
fi

In the different docker-compose.yml files, I do not overwrite the entrypoint of the container.
When my devcontainer launches, I need to start the dotnet app like this dotnet watch run --project DocumentStore

Can you help me with the following:

(1) Terminal process stops when I exit the devcontainer using “Close Remote Connection”
How can I leave my dotnet process running in the container when I close the remote connection? With the current setup, the dotnet process seems to stop immediately when I close the connection.

(2) Setup.sh script asks me to hit a key with this message “Done. Press any key to close the terminal.”
It’s great that I can see the progress of the setup script, but is there any way that the startup process can continue without having to hit a key?

(3) Is there any way to start the dotnet process (command dotnet watch run --project DocumentStore) when the container launches for the first time (after completion of setup.sh)?

Your input would be greatly appreciated!

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật