[PR #6330] [WIP] Feat: Add dedicated Docker setup for web development #20810

Closed
opened 2026-04-14 21:45:36 -05:00 by GiteaMirror · 0 comments
Owner

Original Pull Request: https://github.com/actualbudget/actual/pull/6330

State: closed
Merged: No


I was unable to get the current docker-compose setup working on my local environment. Despite trying various configurations, I consistently encountered 504 Gateway Timeouts (server proxying to localhost instead of the container) and issues with the backend worker (kcab.worker) not being built.

Instead of modifying the existing files (and risking breaking the workflow for others), I created a dedicated configuration specifically for web development.

With this new setup, I can successfully load Actual on port 5006, with the server correctly proxying requests to the frontend and fully working hot-reloading.

Changes
New Files:

docker-compose.web-dev.yml: A dedicated compose file that sets up the correct networking and startup commands (yarn start:browser) for web development.

Dockerfile.web-dev: A specific Dockerfile optimized for this dev workflow.

Code Updates (for Docker compatibility):

packages/sync-server/src/app.ts: Updated to use process.env.CLIENT_URL for the proxy target. This allows the server to point to the web container instead of hardcoded localhost.

vite.config.mts: Added ALLOWED_HOSTS support to prevent "Invalid Host Header" errors when accessing Vite through the Docker network.

Note to Reviewers
I opted to introduce new file names (*.web-dev) to avoid conflicts with the existing setup. Regarding the changes to app.ts and vite.config.mts: these were necessary to make the app configurable via environment variables (essential for Docker networking). If there is a preferred way to handle these config overrides without touching the source files, please let me know, and I will adjust the PR accordingly.

How to test
Run the new compose file:

Bash

docker compose -f docker-compose.web-dev.yml up --build
Navigate to http://localhost:5006.

The app should load correctly with the backend worker running.

**Original Pull Request:** https://github.com/actualbudget/actual/pull/6330 **State:** closed **Merged:** No --- I was unable to get the current docker-compose setup working on my local environment. Despite trying various configurations, I consistently encountered 504 Gateway Timeouts (server proxying to localhost instead of the container) and issues with the backend worker (kcab.worker) not being built. Instead of modifying the existing files (and risking breaking the workflow for others), I created a dedicated configuration specifically for web development. With this new setup, I can successfully load Actual on port 5006, with the server correctly proxying requests to the frontend and fully working hot-reloading. Changes New Files: docker-compose.web-dev.yml: A dedicated compose file that sets up the correct networking and startup commands (yarn start:browser) for web development. Dockerfile.web-dev: A specific Dockerfile optimized for this dev workflow. Code Updates (for Docker compatibility): packages/sync-server/src/app.ts: Updated to use process.env.CLIENT_URL for the proxy target. This allows the server to point to the web container instead of hardcoded localhost. vite.config.mts: Added ALLOWED_HOSTS support to prevent "Invalid Host Header" errors when accessing Vite through the Docker network. Note to Reviewers I opted to introduce new file names (*.web-dev) to avoid conflicts with the existing setup. Regarding the changes to app.ts and vite.config.mts: these were necessary to make the app configurable via environment variables (essential for Docker networking). If there is a preferred way to handle these config overrides without touching the source files, please let me know, and I will adjust the PR accordingly. How to test Run the new compose file: Bash docker compose -f docker-compose.web-dev.yml up --build Navigate to http://localhost:5006. The app should load correctly with the backend worker running.
GiteaMirror added the pull-request label 2026-04-14 21:45:36 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/actual#20810