Replies: 6 comments 10 replies
-
Ok I came up with a Dockerfile that worked! The problem is that I've never installed some of the Node requirements before. This updated Dockerfile installs npm, yarn, then installs the node requirements. It's heavily inspired by @tspycher from Discord (repo: https://github.com/tspycher/tspycher)
|
Beta Was this translation helpful? Give feedback.
-
Created this basic guide for self hosting that may be helpful: #802 |
Beta Was this translation helpful? Give feedback.
-
Ok! I was able to get Pynecone deployed and working on Fly.io as a Docker deployment, and the server responses work!
I think the configs can be cleaned up quite a bit, but this is working for me at the moment, so I don't want to mess it up by poking the bear too much ;)
|
Beta Was this translation helpful? Give feedback.
-
@janzheng could you please explain how these ports work on the Pynecode (now reflex) app? Deploying the app as been a real nightmare for me. I followed all your instructions and still fail to get a running version of my app. Did you try deploying it in any other way as well such as AWS Elastic Beanstalk? |
Beta Was this translation helpful? Give feedback.
-
I wanted to look for some guidance on 2 issues around docker - k8s based deployment:
Stateless image:
Issue with 2 ports: If I try to build it and run in in Docker and Is there a way to get traffic to go to only one port. I have tried --
If I go to url:8000/[page-route], I get a page from the uvicorn reverse proxy with a caption [not found]. Is there a 'simple' way to deploy this that is stateless and all traffic is to and from the same port? What am I missing here? |
Beta Was this translation helpful? Give feedback.
-
For the Edification of others: this worked: Dockerfile:
config-template.py: from os import getenv
API_URL = getenv("API_URL", default="")
if not API_URL:
raise ValueError('The environment variable "API_URL" must be set. Try `docker run -e API_URL="http://foo-url:3000"`')
template = f"""
import reflex as rx
config = rx.Config(
app_name="my-app",
api_url="{API_URL}"
)
"""
with open('rxconfig.py', 'w') as f:
f.write(template)
print("Wrote as rxconfig.py:")
print(template) entrypoint.sh: python3 /app/my-app/config-template.py
/usr/local/bin/reflex init
reflex run --env dev --backend-port 8000 To run:
|
Beta Was this translation helpful? Give feedback.
-
Hi there,
I'm having trouble building and running Docker locally. It's just a vanilla install, since I'm trying to understand how everything works under the hood.
Partly is I'm not sure what to call things / rename things in the config (e.g. "app"). My app is called "thirdtry" and my current venv and app is all under that name, e.g.
thirdtry/thirdtry/thirdtry.py
.Which parts should I rename to
thirdtry
and which parts should I keep asapp
? Variations of errors I get include:pc init
"pc not found" when I buildHere are my steps:
pc init
andpc run
pconfig.py
like this for Docker:Dockerfile
:requirements.txt
:Ok I know it's something silly like a misnamed folder or app, but I have no idea how to fix it...
Beta Was this translation helpful? Give feedback.
All reactions