Cloudron makes it easy to run web apps like WordPress, Nextcloud, GitLab on your server. Find out more or install now.


Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Bookmarks
  • Search
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Brand Logo

Cloudron Forum

Apps | Demo | Docs | Install
  1. Cloudron Forum
  2. Support
  3. How to run simple Python scripts on Cloudron

How to run simple Python scripts on Cloudron

Scheduled Pinned Locked Moved Solved Support
17 Posts 9 Posters 2.6k Views 9 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sarthak.narayan
    wrote on last edited by
    #1

    Is there a way to run simple Python scripts on Cloudron packaged in a Docker container? I know Cloudron requires a health check endpoint. Is it possible to run simple scripts without a health check endpoint?

    T 1 Reply Last reply
    1
    • nebulonN Away
      nebulonN Away
      nebulon
      Staff
      wrote on last edited by
      #2

      You could put the app in debug mode, then the healthchecks are skipped. But not sure if that is sufficient for your use-case.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sarthak.narayan
        wrote on last edited by
        #3

        Can you point me to the docs that show how to put it in debug mode?

        1 Reply Last reply
        0
        • BrutalBirdieB Offline
          BrutalBirdieB Offline
          BrutalBirdie
          Partner
          wrote on last edited by
          #4

          docs.cloudron.io/

          Like my work? Consider donating a drink. Cheers!

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sarthak.narayan
            wrote on last edited by
            #5

            So just to clarify instead of doing cloudron install --image <image-name> I do cloud debug --image <image-name> ?

            1 Reply Last reply
            0
            • robiR Offline
              robiR Offline
              robi
              wrote on last edited by
              #6

              Why not run the python scripts in the LAMP app which is already set up for all health checks?

              Conscious tech

              1 Reply Last reply
              1
              • S Offline
                S Offline
                sarthak.narayan
                wrote on last edited by
                #7

                Why should I do that if I just want to run a simple Python script.

                murgeroM 1 Reply Last reply
                0
                • C Offline
                  C Offline
                  ccfu
                  wrote on last edited by
                  #8

                  Why not? What app were you intending to use?

                  1 Reply Last reply
                  0
                  • S sarthak.narayan

                    Why should I do that if I just want to run a simple Python script.

                    murgeroM Offline
                    murgeroM Offline
                    murgero
                    App Dev
                    wrote on last edited by
                    #9

                    @sarthak-narayan LAMP app can run python - may be tiny over kill but unless you build your own app you're sol

                    --
                    https://urgero.org
                    ~ Professional Nerd. Freelance Programmer. ~

                    1 Reply Last reply
                    1
                    • robiR Offline
                      robiR Offline
                      robi
                      wrote on last edited by
                      #10

                      You can also run your "simple Python script" in Jupiter notebooks, or with CTfreak which will manage a crontab for you to run it anywhere you can ssh into.

                      Perhaps it's more useful to share what you're trying to achieve, and what the script does, so we can offer more useful suggestions.

                      Conscious tech

                      1 Reply Last reply
                      2
                      • girishG Offline
                        girishG Offline
                        girish
                        Staff
                        wrote on last edited by girish
                        #11

                        So what you want to do is to run a python script as a cron job ? Does the script terminate or is it like a daemon ?

                        1 Reply Last reply
                        0
                        • BrutalBirdieB Offline
                          BrutalBirdieB Offline
                          BrutalBirdie
                          Partner
                          wrote on last edited by
                          #12

                          @sarthak-narayan
                          Lets clear things up.
                          You want to install a custom Cloudron App, which runs a Python program.
                          Correct?

                          For example the TeamSpeak app does something similar: https://git.cloudron.io/cloudron/teamspeak-app
                          It might be good to take a look there.

                          I am also running multiple python programs in the LAMP app with my webpage as a daemon.
                          And even if an app would not have python.. mostly impossible since its in the base included: https://git.cloudron.io/cloudron/docker-base-image/-/blob/master/Dockerfile#L45

                          There is always https://pyinstaller.org/en/stable/ to make a binary.

                          Like my work? Consider donating a drink. Cheers!

                          1 Reply Last reply
                          0
                          • S Offline
                            S Offline
                            sarthak.narayan
                            wrote on last edited by
                            #13

                            Got it thanks. I am planning to install and run nginx for health check and then run my python script inside it as a cronjob.

                            robiR 1 Reply Last reply
                            0
                            • fbartelsF Offline
                              fbartelsF Offline
                              fbartels
                              App Dev
                              wrote on last edited by fbartels
                              #14

                              If it is really just a python script, that otherwise does not have a Webinterface, i would just build my own container braised on the python Debian packages and start it in the background through the cli.

                              Somewhere here in this forum i posted how I'm running imapsync on my cloudron to migrate mails. Will edit this post once i found it.

                              Here it is:

                              
                              docker run --rm --network host gilleslamiral/imapsync imapsync \
                              --host1 old.server.com --user1 old.user --password1 REDACTED --ssl1 \
                              --host2 127.0.0.1 --user2 cloudron.user@domain --password2 REDACTED --ssl2 \
                              --nosslcheck --useheader Message-Id --automap --dry
                              
                              1 Reply Last reply
                              1
                              • S sarthak.narayan

                                Got it thanks. I am planning to install and run nginx for health check and then run my python script inside it as a cronjob.

                                robiR Offline
                                robiR Offline
                                robi
                                wrote on last edited by robi
                                #15

                                @sarthak-narayan why bother with nginx when you can run another one line python script to serve the health check?

                                Conscious tech

                                1 Reply Last reply
                                1
                                • girishG Offline
                                  girishG Offline
                                  girish
                                  Staff
                                  wrote on last edited by
                                  #16

                                  I have the same question as @robi .

                                  Cloudron has support for special @service cron type - https://docs.cloudron.io/apps/#cron . You can just put it in an existing app (if that makes sense).

                                  1 Reply Last reply
                                  1
                                  • S sarthak.narayan

                                    Is there a way to run simple Python scripts on Cloudron packaged in a Docker container? I know Cloudron requires a health check endpoint. Is it possible to run simple scripts without a health check endpoint?

                                    T Offline
                                    T Offline
                                    tatkinson
                                    wrote on last edited by
                                    #17

                                    @sarthak-narayan The upcoming version of n8n will include Python support in the Code node.
                                    https://docs.n8n.io/1-0-preview/

                                    1 Reply Last reply
                                    1
                                    • girishG girish marked this topic as a question on
                                    • girishG girish has marked this topic as solved on
                                    Reply
                                    • Reply as topic
                                    Log in to reply
                                    • Oldest to Newest
                                    • Newest to Oldest
                                    • Most Votes


                                    • Login

                                    • Don't have an account? Register

                                    • Login or register to search.
                                    • First post
                                      Last post
                                    0
                                    • Categories
                                    • Recent
                                    • Tags
                                    • Popular
                                    • Bookmarks
                                    • Search