|
преди 5 месеца | |
---|---|---|
.. | ||
.dockerignore | преди 8 месеца | |
Dockerfile | преди 5 месеца | |
README.md | преди 8 месеца |
This docker deployment runs Reflex in prod mode, exposing two HTTP ports:
3000
- node NextJS server using optimized production build8000
- python gunicorn server hosting the Reflex backendThe deployment also runs a local Redis server to store state for each user.
docker build -t reflex-simple-two-port .
docker run -p 3000:3000 -p 8000:8000 reflex-simple-two-port
Note that this container has no persistence and will lose all data when stopped. You can use bind mounts or named volumes to persist the database and uploaded_files directories as needed.
This container should be used with an existing load balancer or reverse proxy to route traffic to the appropriate port inside the container.
For example, the following Caddyfile can be used to terminate TLS and forward traffic to the frontend and backend from outside the container.
my-domain.com
encode gzip
@backend_routes path /_event/* /ping /_upload /_upload/*
handle @backend_routes {
reverse_proxy localhost:8000
}
reverse_proxy localhost:3000