This guide explains how to run weconnect-server in a local Docker environment.
- Docker Desktop (or Docker Engine + Compose plugin on Linux)
- Git
All WeVote services (WeVoteServer, WebApp, weconnect-server) share a Docker network named wevote. Create it once:
docker network create wevoteCopy the template and fill in your values:
cp .env-template .envWe have real commercial SSL certs from 'Sectigo' for wevotedeveloper.com
You can download them from https://drive.google.com/drive/folders/1q0KB2B8HB-AGTMLXrYq7x96McaEJ9_od?usp=drive_link
If you don't have access to this drive, talk to your team leader.
The two files are wevotedeveloper.com_key.txt and wevotedeveloper.com.crt
Copy them to your cert directory WeVoteServer/cert
Then change your .env file to be
# .env
DATABASE_USER=postgres
DATABASE_PASSWORD=devpg
HTTPS_SSL_CERT=./cert/wevotedeveloper.com.crt
HTTPS_SSL_KEY=./cert/wevotedeveloper.com_key.txtdocker compose up --buildThis will:
- Start a PostgreSQL database
- Wait for the database to be healthy
- Run
prisma generateandprisma migrate deployto apply all migrations - Start the weconnect-server with nodemon (auto-reloads on file changes)
The API will be available at https://wevotedeveloper.com:4500/.
To run in the background:
docker compose up --build -ddocker compose downTo also remove the database volume (deletes all data):
docker compose down -vThe source directory is mounted into the container at /app, so edits you make on the host are reflected immediately. nodemon watches for changes and restarts the server automatically.
To run Prisma commands inside the running container:
# Open a shell in the api container
docker compose exec weconnect-api sh
# Then run Prisma commands
npx prisma studio # visual database browser at http://localhost:5555
npx prisma migrate dev # create a new migration
npx prisma db seed # run seed script (if configured)Or run them directly without opening a shell:
docker compose exec weconnect-api npx prisma studio
docker compose exec weconnect-api npx prisma migrate dev --name my_migrationdocker compose exec weconnect-api npm testdocker compose logs -f weconnect-api # follow api logs
docker compose logs -f weconnect-db # follow database logsYou can also see these logs in docker.desktop, and in a terminal (possibly within WebStorm) in which you ran the docker compose up command.
docker network create wevote fails with "already exists"
The network already exists — this is fine, proceed to the next step.
Prisma migration fails on startup
Check that the database settings are correct in .env. Run docker compose logs weconnect-db to inspect database errors.
node_modules issues or package errors
Rebuild the image to reinstall dependencies:
docker compose build --no-cache
docker compose up- Make sure your WebStorm is updated to the latest version, at least to "WebStorm 2025.2.6.1"
- The WebStorm Docker plugin is bundled with this version and later.
- Open settings using *Ctrl + Alt + S (Windows/Linux) or Cmd + , (macOS).
- Navigate to Build, Execution, Deployment | Docker.
- Click the + icon to add a Docker server. (This is what it looks like on macOS)
- Press Ok to save the docker server connection.
- Go to the main menu and select Run | Edit Configurations.
- Click the + (Add New Configuration) button and select Attach to Node.js/Chrome.
- Name the run configuration something like
Attach to Docker API - Host needs to be
localhost - Port needs to be
9229 - DO NOT CHECK "Reconnect automatically"
- Setup a Remote URLs of local files, Press the + to open a blank URL mapping line.
- A file selection dialog will appear. Select the
weconnect-server.jsfile. (Leave the defaulthttp://localhost:9229Remote URL as is.) - Click OK to save the configuration
- Start the Docker setup with the
docker compose upcommand in a terminal. - Once the
Container weconnect-server-weconnect-db-1starts up, you can press the Debug "bug" icon, in Webstorm for the "Attach to Docker API", and you will be debugging. Set a breakpoint, run your API call and execution should stop at the breakpoint.
Note about ephemeral containers: In Docker.desktop, under weconnect-server, you will see the weconnect-api-1 container and the weconnect-db-1 container, and while
debugging you may see ephemeral (temporary anonymous) containers like unruffled_shannon while debugging -- these
containers are debugging related and can be ignored.

