apiVersion: apps/v1
kind: Deployment
metadata:
    name: node-todo-deployment
    labels: 
        app: node-todo
spec:
    replicas: 2
    selector:
        matchLabels:
            app: node-todo
    template:
        metadata:
            labels:
                app: node-todo
        spec:
            containers:
            - name: mongodb
              image: mongo:4.4.7
            - name: node-todo
              image: 139052083994.dkr.ecr.us-east-2.amazonaws.com/thezachsmith/node-todo:<git_commit_hash>
              env:
              - name: mongoHostname
                value: "localhost"
              - name: mongoPort
                value: "27017"
              args: ["wait-for-it/wait-for-it.sh", "$(mongoHostname):$(mongoPort)","-t", "0", "--", "./setup.sh"]
              ports:
              - containerPort: 8080
