apiVersion: apps/v1
kind: Deployment
metadata:
  name: fhirdb-deployment
  labels:
    app: fhirdb
spec:
  replicas: 1
  selector:
    matchLabels:
      app: fhirdb
  template:
    metadata:
      labels:
        app: fhirdb
    spec:
      containers:
      - name: fhirdb
        image: mcr.microsoft.com/mssql/server:2017-latest
        ports:
        - containerPort: 1433
        env:
        - name: MSSQL_PID
          value: "Developer"
        - name: ACCEPT_EULA
          value: "Y"
        - name: MSSQL_SA_PASSWORD
          valueFrom:
            secretKeyRef:
              name: mssql
              key: SA_PASSWORD
        volumeMounts:
        - name: mssqldb
          mountPath: /var/opt/mssql
      volumes:
      - name: mssqldb
        persistentVolumeClaim:
          claimName: fhir-api-data