D
Dokployโ€ข12mo ago
Wise

Deploy Flask App

I have a flask application written in flask, how can I run it in Dokploy.
18 Replies
๐— ๐—ฟ๐Ÿญ๐—•๐—น๐—ฎ๐˜‡๐—ฒ
1. pip freeze > requirements.txt 2. You need main.py
Wise
WiseOPโ€ข12mo ago
okay what type of build file would this be?
๐— ๐—ฟ๐Ÿญ๐—•๐—น๐—ฎ๐˜‡๐—ฒ
All builders needs requirements because in requirements you have a list of packages
Wise
WiseOPโ€ข12mo ago
okay
Wise
WiseOPโ€ข12mo ago
I am trying to deploy it now but it is not working here is what my github looks like and dokploy. But I click deploy and it says docker deployed but after that it just instantly ends.
No description
No description
Wise
WiseOPโ€ข12mo ago
* Serving Flask app 'main' * Debug mode: off WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Running on http://127.0.0.1:3000 Press CTRL+C to quit It says this and I connect it to the domain but it does not work when I go to that domain. It responds with bad gateway. nextjs apps work okay. Flask does not.
Siumauricio
Siumauricioโ€ข12mo ago
Probably there is missing something in your code, I remember tried to deploy a django project https://github.com/Dokploy/django-demo/tree/demo-2 you can check there I remember was running fine, I guess the same idea could be similar to flask
GitHub
GitHub - Dokploy/django-demo at demo-2
Contribute to Dokploy/django-demo development by creating an account on GitHub.
Wise
WiseOPโ€ข12mo ago
thank you I will try this.
Wise
WiseOPโ€ข12mo ago
got this error when trying to deploy:
Initializing deployment
Cloning Repo Custom [email protected]:Dokploy/django-demo.git to /etc/dokploy/applications/test-ededed-5edc2c: โœ…
Cloning into '/etc/dokploy/applications/test-ededed-5edc2c'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

ERROR Cloning Custom Git: Error: child exited with code 128: โŒ
Initializing deployment
Cloning Repo Custom [email protected]:Dokploy/django-demo.git to /etc/dokploy/applications/test-ededed-5edc2c: โœ…
Cloning into '/etc/dokploy/applications/test-ededed-5edc2c'...
Host key verification failed.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

ERROR Cloning Custom Git: Error: child exited with code 128: โŒ
No description
Siumauricio
Siumauricioโ€ข12mo ago
use https:// you are using the ssh way if you use the [email protected] you need to use ssh key in your account
Wise
WiseOPโ€ข12mo ago
I am still getting an error.
Cloned Custom Git https://github.com/Dokploy/django-demo.git: โœ…

Build nixpacks: โœ…
Source Type: git: โœ…

Nixpacks was unable to generate a build plan for this app.
Please check the documentation for supported languages: https://nixpacks.com

The contents of the app directory are:

.gitignore
mysite/
README.md
.git/
ERROR: Error: child exited with code 1: โŒ
Cloned Custom Git https://github.com/Dokploy/django-demo.git: โœ…

Build nixpacks: โœ…
Source Type: git: โœ…

Nixpacks was unable to generate a build plan for this app.
Please check the documentation for supported languages: https://nixpacks.com

The contents of the app directory are:

.gitignore
mysite/
README.md
.git/
ERROR: Error: child exited with code 1: โŒ
๐— ๐—ฟ๐Ÿญ๐—•๐—น๐—ฎ๐˜‡๐—ฒ
Itโ€™s correct because nixpacks canโ€™t see installation directory Firstly you need to copy only mysite And this directory try to install
Siumauricio
Siumauricioโ€ข12mo ago
correct, you should this URL: https://github.com/Dokploy/django-demo.git Branch: demo-2 directory: /django-main
GitHub
GitHub - Dokploy/django-demo
Contribute to Dokploy/django-demo development by creating an account on GitHub.
๐— ๐—ฟ๐Ÿญ๐—•๐—น๐—ฎ๐˜‡๐—ฒ
My project with flask is working. Can I see you project all configuration files to help you fast. You can write on DM
Wise
WiseOPโ€ข12mo ago
Yes I can do that.

Did you find this page helpful?