This commit is contained in:
@@ -18,39 +18,83 @@ services:
|
||||
retries: 10
|
||||
|
||||
node1:
|
||||
build: .
|
||||
build:
|
||||
context: .
|
||||
dockerfile: dev.Dockerfile
|
||||
container_name: node1
|
||||
hostname: node1
|
||||
env_file: .env
|
||||
environment:
|
||||
DATABASE_URL: ecto://elixir_ai:elixir_ai@db/elixir_ai_dev
|
||||
PHX_HOST: localhost
|
||||
PHX_SERVER: "true"
|
||||
PORT: 4000
|
||||
MIX_ENV: dev
|
||||
RELEASE_NODE: elixir_ai@node1
|
||||
RELEASE_COOKIE: secret_cluster_cookie
|
||||
SECRET_KEY_BASE: F1nY5uSyD0HfoWejcuuQiaQoMQrjrlFigb3bJ7p4hTXwpTza6sPLpmd+jLS7p0Sh
|
||||
user: root
|
||||
command: |
|
||||
sh -c '
|
||||
chown -R elixir:elixir /app/_build
|
||||
chown -R elixir:elixir /app/deps
|
||||
su elixir -c "elixir --sname elixir_ai@node1 --cookie secret_cluster_cookie -S mix phx.server"
|
||||
'
|
||||
volumes:
|
||||
- .:/app
|
||||
- /app/_build
|
||||
ports:
|
||||
- "4001:4000"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO-", "http://localhost:4000/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
node2:
|
||||
build: .
|
||||
build:
|
||||
context: .
|
||||
dockerfile: dev.Dockerfile
|
||||
container_name: node2
|
||||
hostname: node2
|
||||
env_file: .env
|
||||
environment:
|
||||
DATABASE_URL: ecto://elixir_ai:elixir_ai@db/elixir_ai_dev
|
||||
PHX_HOST: localhost
|
||||
PHX_SERVER: "true"
|
||||
PORT: 4000
|
||||
MIX_ENV: dev
|
||||
RELEASE_NODE: elixir_ai@node2
|
||||
RELEASE_COOKIE: secret_cluster_cookie
|
||||
SECRET_KEY_BASE: F1nY5uSyD0HfoWejcuuQiaQoMQrjrlFigb3bJ7p4hTXwpTza6sPLpmd+jLS7p0Sh
|
||||
user: root
|
||||
command: |
|
||||
sh -c '
|
||||
chown -R elixir:elixir /app/_build
|
||||
chown -R elixir:elixir /app/deps
|
||||
su elixir -c "elixir --sname elixir_ai@node2 --cookie secret_cluster_cookie -S mix phx.server"
|
||||
'
|
||||
volumes:
|
||||
- .:/app
|
||||
- /app/_build
|
||||
ports:
|
||||
- "4002:4000"
|
||||
depends_on:
|
||||
db:
|
||||
condition: service_healthy
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO-", "http://localhost:4000/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
nginx:
|
||||
image: nginx:alpine
|
||||
ports:
|
||||
- "80:80"
|
||||
- "8080:80"
|
||||
volumes:
|
||||
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
depends_on:
|
||||
|
||||
Reference in New Issue
Block a user