# This Dockerfile is used to deploy a single-container Reflex app instance # to services like Render, Railway, Heroku, GCP, and others. # It uses a reverse proxy to serve the frontend statically and proxy to backend # from a single exposed port, expecting TLS termination to be handled at the # edge by the given platform. FROM python:3.11 # If the service expects a different port, provide it here (f.e Render expects port 10000) ARG PORT=8080 # Only set for local/direct access. When TLS is used, the API_URL is assumed to be the same as the frontend. ARG API_URL ENV PORT=$PORT API_URL=${API_URL:-http://localhost:$PORT} # Install Caddy server inside image RUN apt-get update -y && apt-get install -y caddy && rm -rf /var/lib/apt/lists/* WORKDIR /app # Create a simple Caddyfile to serve as reverse proxy RUN cat > Caddyfile <