Twilio simulator with virtual phone numbers and SMS messaging capabilities
439
Self-contained image that serves a web UI and REST/WebSocket API for a Twilio-like SMS/webhook simulator. The image bundles:
Exposed on port 3000 by default.
docker pull navneetlalg/twilio-simulator:latest
Use your host Postgres or host.docker.internal on macOS/Windows:
docker run -d --name twilio-simulator -p 3000:3000 \
-e NODE_ENV=production -e PORT=3000 \
-e DB_HOST=host.docker.internal -e DB_PORT=5432 \
-e DB_NAME=twilio_simulator -e DB_USER=postgres -e DB_PASSWORD=password \
-e DB_SSL=false -e JWT_SECRET=change-me -e CORS_ORIGIN="*" \
navneetlalg/twilio-simulator:latest
curl -s http://localhost:3000/health | cat
# open UI at http://localhost:3000
# initialize schema (alternative): run app migrations once against your DB
docker run --rm --name twilio-migrate \
-e NODE_ENV=production \
-e DB_HOST=host.docker.internal -e DB_PORT=5432 \
-e DB_NAME=twilio_simulator -e DB_USER=postgres -e DB_PASSWORD=password \
navneetlalg/twilio-simulator:latest node dist/scripts/migrate.js
# create isolated network
docker network create ts-net >/dev/null 2>&1 || true
# start Postgres
docker run -d --name ts-db --network ts-net \
-e POSTGRES_DB=twilio_simulator -e POSTGRES_USER=postgres -e POSTGRES_PASSWORD=password \
postgres:17-alpine
# start the simulator
docker run -d --name twilio-simulator --network ts-net -p 3000:3000 \
-e NODE_ENV=production -e PORT=3000 \
-e DB_HOST=ts-db -e DB_PORT=5432 \
-e DB_NAME=twilio_simulator -e DB_USER=postgres -e DB_PASSWORD=password \
-e DB_SSL=false -e JWT_SECRET=change-me -e CORS_ORIGIN="*" \
navneetlalg/twilio-simulator:latest
# note: the init-db.sql runs only on first boot of a fresh PG data volume
# to re-run it, remove the PG volume or use a new named volume
services:
postgres:
image: postgres:17-alpine
environment:
POSTGRES_DB: twilio_simulator
POSTGRES_USER: postgres
POSTGRES_PASSWORD: password
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres -d twilio_simulator"]
interval: 10s
timeout: 5s
retries: 5
app:
image: navneetlalg/twilio-simulator:latest
environment:
NODE_ENV: production
PORT: 3000
DB_HOST: postgres
DB_PORT: 5432
DB_NAME: twilio_simulator
DB_USER: postgres
DB_PASSWORD: password
DB_SSL: "false"
JWT_SECRET: change-me
CORS_ORIGIN: "*"
ports:
- "3000:3000"
depends_on:
postgres:
condition: service_healthy
GET /health)node:22-alpine and runs as a non-root user./public by Express.MIT
Content type
Image
Digest
sha256:098801355…
Size
57.4 MB
Last updated
about 1 year ago
docker pull navneetlalg/twilio-simulator