fast failover
This commit is contained in:
@@ -1,25 +1,26 @@
|
||||
version: "3.8"
|
||||
|
||||
services:
|
||||
phoenix1:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
dockerfile: dev.Dockerfile
|
||||
container_name: phoenix1
|
||||
hostname: phoenix1
|
||||
environment:
|
||||
- RELEASE_NODE=backend@phoenix1
|
||||
- RELEASE_DISTRIBUTION=sname
|
||||
- RELEASE_COOKIE=super_secret_cookie_change_in_production
|
||||
- PHX_HOST=localhost
|
||||
- PHX_SERVER=true
|
||||
- PORT=4000
|
||||
- DATABASE_URL=ecto://postgres:postgres@db/backend_dev
|
||||
- SECRET_KEY_BASE=W8nGKNhNR8vKj6A4VnwN5h5h7RZvkKmZPqxqzLzYxXGQqC6HnKp2Wm8MNqKpQxZv
|
||||
- MIX_ENV=dev
|
||||
- NODE_NAME=backend@phoenix1
|
||||
- COOKIE=dev_cookie
|
||||
- CLUSTER_NODES=backend@phoenix1,backend@phoenix2,backend@phoenix3
|
||||
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
|
||||
ports:
|
||||
- "4001:4000"
|
||||
user: root
|
||||
command: |
|
||||
sh -c '
|
||||
chown -R elixir:elixir /app/_build
|
||||
su elixir -c "elixir --sname $${NODE_NAME} --cookie $${COOKIE} -S mix phx.server"
|
||||
'
|
||||
volumes:
|
||||
- ./backend:/app
|
||||
- /app/_build
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO-", "http://localhost:4000/api/health"]
|
||||
interval: 10s
|
||||
@@ -29,22 +30,25 @@ services:
|
||||
phoenix2:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
dockerfile: dev.Dockerfile
|
||||
container_name: phoenix2
|
||||
hostname: phoenix2
|
||||
environment:
|
||||
- RELEASE_NODE=backend@phoenix2
|
||||
- RELEASE_DISTRIBUTION=sname
|
||||
- RELEASE_COOKIE=super_secret_cookie_change_in_production
|
||||
- PHX_HOST=localhost
|
||||
- PHX_SERVER=true
|
||||
- PORT=4000
|
||||
- DATABASE_URL=ecto://postgres:postgres@db/backend_dev
|
||||
- SECRET_KEY_BASE=W8nGKNhNR8vKj6A4VnwN5h5h7RZvkKmZPqxqzLzYxXGQqC6HnKp2Wm8MNqKpQxZv
|
||||
- MIX_ENV=dev
|
||||
- NODE_NAME=backend@phoenix2
|
||||
- COOKIE=dev_cookie
|
||||
- CLUSTER_NODES=backend@phoenix1,backend@phoenix2,backend@phoenix3
|
||||
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
|
||||
ports:
|
||||
- "4002:4000"
|
||||
user: root
|
||||
command: |
|
||||
sh -c '
|
||||
chown -R elixir:elixir /app/_build
|
||||
su elixir -c "elixir --sname $${NODE_NAME} --cookie $${COOKIE} -S mix phx.server"
|
||||
'
|
||||
volumes:
|
||||
- ./backend:/app
|
||||
- /app/_build
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO-", "http://localhost:4000/api/health"]
|
||||
interval: 10s
|
||||
@@ -54,22 +58,25 @@ services:
|
||||
phoenix3:
|
||||
build:
|
||||
context: ./backend
|
||||
dockerfile: Dockerfile
|
||||
dockerfile: dev.Dockerfile
|
||||
container_name: phoenix3
|
||||
hostname: phoenix3
|
||||
environment:
|
||||
- RELEASE_NODE=backend@phoenix3
|
||||
- RELEASE_DISTRIBUTION=sname
|
||||
- RELEASE_COOKIE=super_secret_cookie_change_in_production
|
||||
- PHX_HOST=localhost
|
||||
- PHX_SERVER=true
|
||||
- PORT=4000
|
||||
- DATABASE_URL=ecto://postgres:postgres@db/backend_dev
|
||||
- SECRET_KEY_BASE=W8nGKNhNR8vKj6A4VnwN5h5h7RZvkKmZPqxqzLzYxXGQqC6HnKp2Wm8MNqKpQxZv
|
||||
- MIX_ENV=dev
|
||||
- NODE_NAME=backend@phoenix3
|
||||
- COOKIE=dev_cookie
|
||||
- CLUSTER_NODES=backend@phoenix1,backend@phoenix2,backend@phoenix3
|
||||
- OTEL_EXPORTER_OTLP_ENDPOINT=http://otel-collector:4318
|
||||
ports:
|
||||
- "4003:4000"
|
||||
user: root
|
||||
command: |
|
||||
sh -c '
|
||||
chown -R elixir:elixir /app/_build
|
||||
su elixir -c "elixir --sname $${NODE_NAME} --cookie $${COOKIE} -S mix phx.server"
|
||||
'
|
||||
volumes:
|
||||
- ./backend:/app
|
||||
- /app/_build
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO-", "http://localhost:4000/api/health"]
|
||||
interval: 10s
|
||||
@@ -91,10 +98,12 @@ services:
|
||||
client:
|
||||
build:
|
||||
context: ./client
|
||||
dockerfile: Dockerfile
|
||||
dockerfile: dev.Dockerfile
|
||||
container_name: client
|
||||
volumes:
|
||||
- ./client:/app
|
||||
ports:
|
||||
- "5173:80"
|
||||
- "5173:5173"
|
||||
depends_on:
|
||||
- nginx-lb
|
||||
|
||||
@@ -104,8 +113,4 @@ services:
|
||||
command: ["--config=/etc/otel-collector-config.yaml"]
|
||||
volumes:
|
||||
- ./otel-collector-config.yaml:/etc/otel-collector-config.yaml
|
||||
ports:
|
||||
- "4318:4318" # OTLP HTTP receiver
|
||||
- "4317:4317" # OTLP gRPC receiver
|
||||
- "8888:8888" # Prometheus metrics
|
||||
- "8889:8889" # Prometheus exporter metrics
|
||||
|
||||
|
||||
Reference in New Issue
Block a user