<p>I have made an api using asp.net core 3.0, I'm also using docker to run my api locally (this because someone in my team is using linux and had some problems). Now I'm trying to deploy my api in the cloud (GCP) using GKE. I followed google documentation on how to do this using the gcloud cli and kubectl and all that. This all worked except that the server crashes instantly and I see in the log files that the MSSQL server is not being found because there is none in my Dockerfile obviously. Instead we set up our sql server in the docker-compose.yaml file. Is there any way to deploy using the compose file or do I have to do this manually somehow? Mind that i'm still a beginner in the containerization world.</p>

<p><a href="https://gist.github.com/Oussie00/40c26f7c3577614c4e6a3eb677677f44" rel="nofollow noreferrer">link to a gist of our dockerfile and compose file</a></p>

<p>Thanks in advance</p>

Oussama Es-salhi
<p>When you deploy to Kubernetes you'll have to deploy the application <strong>and</strong> the database (in your case SQL Server).</p>

<p>You can deploy the database by also following the Google docs for kubectl (best would be to write one YAML file containing the <code>Deployment</code>s and <code>Service</code>s for your app and database).</p>

<p>Alternatively you can re-use your <code>docker-compose.yaml</code> to deploy both to Kubernetes using <a href="https://kompose.io/" rel="noreferrer">Kompose</a>. Kompose translates the Docker Compose YAML manifests to Kubernetes and applies them to your cluster. Kompose has some limitations (no full support of Docker Compose).</p>

<p>And here an advice: running databases in containers in the cloud is no easy thing. You'll have to think about persistent storage, backup, high availability, etc. It is a lot easier to use databases provided by the cloud you run on.</p>
