File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 55# then copy the contents of `frontend.zip` to your static file server (github pages, s3, etc).
66#
77# Azure Static Web App example:
8- # npx @azure/static-web-apps-cli deploy --env production --app-location .web/_static
8+ # npx @azure/static-web-apps-cli deploy --env production --app-location .web/build/client
99#
1010# For dynamic routes to function properly, ensure that 404s are redirected to /404 on the
1111# static file host (for github pages, this works out of the box; remember to create .nojekyll).
1212#
13- # For azure static web apps, add `staticwebapp.config.json` to to `.web/_static ` with the following:
13+ # For azure static web apps, add `staticwebapp.config.json` to to `.web/build/client ` with the following:
1414# {
1515# "responseOverrides": {
1616# "404": {
Original file line number Diff line number Diff line change 11FROM library/caddy
22
3- COPY --from=local/reflex-app /app/.web/_static /srv
3+ COPY --from=local/reflex-app /app/.web/build/client /srv
44ADD Caddyfile /etc/caddy/Caddyfile
Original file line number Diff line number Diff line change @@ -26,13 +26,13 @@ RUN $uv pip install -r requirements.txt
2626# Deploy templates and prepare app
2727RUN reflex init
2828
29- # Export static copy of frontend to /app/.web/_static
29+ # Export static copy of frontend to /app/.web/build/client
3030RUN reflex export --frontend-only --no-zip
3131
3232# Copy static files out of /app to save space in backend image
33- RUN mv .web/_static /tmp/_static
34- RUN rm -rf .web && mkdir .web
35- RUN mv /tmp/_static .web/_static
33+ RUN mv .web/build/client /tmp/client
34+ RUN rm -rf .web && mkdir -p .web/build
35+ RUN mv /tmp/client .web/build/client
3636
3737# Stage 2: copy artifacts into slim image
3838FROM python:3.13-slim
Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ COPY . .
3434
3535ARG PORT API_URL
3636# Download other npm dependencies and compile frontend
37- RUN REFLEX_API_URL=${API_URL:-http://localhost:$PORT} reflex export --loglevel debug --frontend-only --no-zip && mv .web/_static /* /srv/ && rm -rf .web
37+ RUN REFLEX_API_URL=${API_URL:-http://localhost:$PORT} reflex export --loglevel debug --frontend-only --no-zip && mv .web/build/client /* /srv/ && rm -rf .web
3838
3939
4040# Final image with only necessary files
Original file line number Diff line number Diff line change @@ -27,7 +27,7 @@ RUN pip install -r requirements.txt
2727RUN reflex init
2828
2929# Download all npm dependencies and compile frontend
30- RUN reflex export --frontend-only --no-zip && mv .web/_static /* /srv/ && rm -rf .web
30+ RUN reflex export --frontend-only --no-zip && mv .web/build/client /* /srv/ && rm -rf .web
3131
3232# Needed until Reflex properly passes SIGTERM on backend.
3333STOPSIGNAL SIGKILL
You can’t perform that action at this time.
0 commit comments