This guide explains how to run weconnect-client in a local Docker environment.
- Docker Desktop (or Docker Engine + Compose plugin on Linux)
- Git
All WeVote services (WeVoteServer, WebApp, weconnect-server, weconnect-client) share a Docker network named wevote. Create it once:
docker network create wevoteIf you see Error response from daemon: network with name wevote already exists, the network is already set up — proceed to the next step.
Copy the template and optionally modify any settings.
cp src/js/config-template.js src/js/config.jsThe config template assumes you have weconnect-server running locally with SSL on port 4500 (see weconnect-server/docs/DockerSetup.md). To point it to a different backend server, modify your src/js/config.js:
// src/js/config.js
// Point to live production backend server:
STAFF_API_SERVER_ROOT_URL: 'https://teamapi.wevote.org/',
STAFF_API_SERVER_ADMIN_ROOT_URL: 'https://teamapi.wevote.org/admin/',
STAFF_API_SERVER_API_ROOT_URL: 'https://teamapi.wevote.org/apis/v1/',
STAFF_API_SERVER_API_CDN_ROOT_URL: 'https://teamapi.wevote.org/apis/v1/',The Docker Compose file overrides HOSTNAME, PORT, HTTPS_SSL_CERT, and HTTPS_SSL_KEY automatically, so you do not need to set those in config.js for Docker.
docker compose up --buildThe client will be available at https://localhost:4000. In your browser, you can ignore/accept any SSL certificate warnings since we are using a test certificate/key created on container build.
To run in the background:
docker compose up --build -ddocker compose downThe source directory is mounted into the container at /app, so edits you make on the host are reflected immediately. The webpack dev server watches for changes and hot-reloads the browser automatically.
# Open a shell in the running container
docker compose exec weconnect-client sh
# Or run a command directly
docker compose exec weconnect-client npm run lint
docker compose exec weconnect-client npm testdocker compose logs -f weconnect-clientPort 4000 already in use
Another process is using port 4000. Stop it, or change the host port in compose.yaml:
ports:
- "127.0.0.1:4001:4000"node_modules issues or missing packages
Rebuild the image to reinstall dependencies:
docker compose build --no-cache
docker compose upChanges not reflected in the browser
Ensure you are editing files under the mounted source directory. Changes to node_modules or build config may require a container restart:
docker compose restart weconnect-client