Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support Docker Compose Issue #1685

Closed
milimyname opened this issue Sep 13, 2024 · 1 comment
Closed

Support Docker Compose Issue #1685

milimyname opened this issue Sep 13, 2024 · 1 comment

Comments

@milimyname
Copy link

I like the idea of local first software and thank you for trying to solve it and make easier to build a better product for end users and devs!

I found a bug in a tanstack example

Bug with the current .support/docker-compose.yml

Failed to start child :postgres_producer:
{%Protocol.UndefinedError{protocol: Enumerable, value: {:error, {:error, :error, "42601", :syntax_error, "syntax error", [file: "repl_scanner.l", line: "223", routine: "replication_yyerror", severity: "ERROR"]}}, description: ""}, [{Enumerable, :impl_for!, 1, [file: ~c"lib/enum.ex", line: 1]}, {Enumerable, :reduce, 3, [file: ~c"lib/enum.ex", line: 166]}, {Enum, :each, 2, [file: ~c"lib/enum.ex", line: 4399]}, {Electric.Replication.Postgres.Client, :set_display_settings_for_replication, 1, [file: ~c"lib/electric/replication/postgres/client.ex", line: 259]}, {Electric.Replication.Postgres.LogicalReplicationProducer, :init, 1, [file: ~c"lib/electric/replication/postgres/logical_replication_producer.ex", line: 92]}, {GenStage, :init, 1, [file: ~c"lib/gen_stage.ex", line: 1816]}, {:gen_server, :init_it, 2, [file: ~c"gen_server.erl", line: 851]}, {:gen_server, :init_it, 6, [file: ~c"gen_server.erl", line: 814]}]}

Solution .support/docker-compose.yml:

version: "3.3"
name: "electric_example-${PROJECT_NAME:-default}"

services:
  postgres:
    image: postgres:16-alpine
    environment:
      POSTGRES_DB: electric
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: password
    ports:
      - 54321:5432
    volumes:
      - ./postgres.conf:/etc/postgresql/postgresql.conf:ro
    tmpfs:
      - /var/lib/postgresql/data
      - /tmp
    command:
      - postgres
      - -c
      - config_file=/etc/postgresql/postgresql.conf

  backend:
    image: electricsql/electric:latest
    environment:
      DATABASE_URL: postgresql://postgres:password@postgres:5432/electric
      LOGICAL_PUBLISHER_HOST: backend
      AUTH_MODE: insecure
    ports:
      - 3000:3000
    build:
      context: ../packages/sync-service/
    depends_on:
      - postgres

PS: Sorry if it is duplicate

@KyleAMathews
Copy link
Contributor

Hey — I just ran through the README instructions to run the example and it worked as expected.

Screenshot 2024-09-13 at 10 06 13 AM

Perhaps you need to run docker pull electricsql/electric to get the latest image?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants