---
apiVersion: apps/v1
kind: Deployment
metadata:
  name: sidekiq-deployment
  labels:
    app: sidekiq
spec:
  replicas: 1
  selector:
    matchLabels:
      app: sidekiq
  template:
    metadata:
      labels:
        app: sidekiq
    spec:
      containers:
      - name: sidekiq
        image: jlphillips/circuitverse_sidekiq
        volumeMounts:
        - name: circuitverse
          mountPath: /circuitverse
        - name: bundle
          mountPath: /circuitverse/.bundle
        - name: node-modules
          mountPath: /circuitverse/node_modules
        - name: database
          mountPath: /circuitverse/config/database.yml
          subPath: database.docker.yml
        env:
          - name: REDIS_URL
            value: "redis://redis:6379/0"
          - name: COMM_ARG
            value: "exec sidekiq -q default -q mailers"
        # command: ["sleep","infinity"]
        command: ["bundle"]
        args: ["exec","sidekiq","-q","default","-q","mailers"]
        ports:
        - containerPort: 6379
      volumes:
        - name: circuitverse
          hostPath:
            path: /home/jphillips/CircuitVerse
            type: Directory
        - name: bundle
          hostPath:
            path: /home/jphillips/CircuitVerse/.bundle
            type: Directory
        - name: node-modules
          hostPath:
            path: /home/jphillips/CircuitVerse/node_modules
            type: Directory
        - name: database
          hostPath:
            path: /home/jphillips/CircuitVerse/config
            # type: Directory
