Git Product home page Git Product logo

Comments (5)

mellotron avatar mellotron commented on May 29, 2024

This guy has the right idea: https://hub.docker.com/r/shoonoise/cabot-docker/~/dockerfile/

And now I can use environment variables in my config instead of hardcoding a file in a configmap:

         ...
         env:
           - name: CELERY_BROKER_URL
             value: redis://redis:6379/1
           - name: DATABASE_URL
             value: postgres://cabot:passwordhere@postgresql:5432/cabot
           - name: DB_HOST
             value: postgresql
           - name: DB_USER
             value: cabot
           - name: DB_PASS
             value: ....
           - name: DJANGO_SECRET_KEY
             value: Gern0flivPecwaQuolqwrjklqjklqwjklgdfhnsertfadoowonnOck7
           - name: WWW_HTTP_HOST
             value: cabot.example.com

from docker-cabot.

frankh avatar frankh commented on May 29, 2024

The reason it doesn't have a default command is that the same container runs both the webserver and the celery workers.

I'm not sure how kubernetes works exactly, but can you not manually set the command for each service? cc @MrSaints

from docker-cabot.

MrSaints avatar MrSaints commented on May 29, 2024

@frankh @mellotron Yes. You'll need to pass in the command, and spin up multiple containers for the service.

Example:

       - name: web
         command: ["sh", "-c", "cabot migrate && gunicorn cabot.wsgi:application -b 0.0.0.0:5000 --workers=5"]
         image: cabotapp/cabot:0.10.8
         ports:
           - containerPort: 5000
             protocol: TCP
         livenessProbe:
           tcpSocket:
             port: 5000
         readinessProbe:
           tcpSocket:
             port: 5000
         volumeMounts:
          - name: cabot-configmap
            mountPath: /
            readOnly: true
       - name: worker
         command: ["celery", "worker", "-A", "cabot"]
         image: cabotapp/cabot:0.10.8
         ports:
           - containerPort: 5000
             protocol: TCP
         livenessProbe:
           tcpSocket:
             port: 5000
         readinessProbe:
           tcpSocket:
             port: 5000
         volumeMounts:
          - name: cabot-configmap
            mountPath: /
            readOnly: true

I've not included Celery beat in the deployment as it is not something that should be replicated (otherwise you may have checks running multiple times).

from docker-cabot.

22Goodmen avatar 22Goodmen commented on May 29, 2024

@mellotron Did you come right? Can you please share your deployment and service file/

from docker-cabot.

frankh avatar frankh commented on May 29, 2024

There are now kubernetes files included in the repo, please let me know if those aren't working for you

from docker-cabot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.