Skip to content

Instantly share code, notes, and snippets.

@opsb
Last active March 20, 2024 17:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save opsb/7faaa796a96896e285374bcef897cdc0 to your computer and use it in GitHub Desktop.
Save opsb/7faaa796a96896e285374bcef897cdc0 to your computer and use it in GitHub Desktop.
Docker compose for electric
```
version: "3"
services:
db:
image: postgres:16.2
restart: always
ports:
- "15432:5432"
environment:
POSTGRES_PASSWORD: postgres
POSTGRES_USER: postgres
PGDATA: /var/lib/postgresql/data/pgdata
volumes:
- pgdata:/var/lib/postgresql/data
command:
- -c
- wal_level=logical
electric:
image: electricsql/electric
depends_on:
- db
environment:
DATABASE_URL: postgresql://postgres:postgres@db:5432/myapp_dev
DATABASE_REQUIRE_SSL: false
LOGICAL_PUBLISHER_HOST: electric
PG_PROXY_PASSWORD: proxy_password
AUTH_MODE: insecure
ports:
- 5133:5133
- 65432:65432
restart: always
volumes:
pgdata:
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment