Skip to content

Commit 5abfa4a

Browse files
committed
Code for step 2
1 parent 26423e0 commit 5abfa4a

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed

config/dev.exs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ config :elixir_monitoring_prom, ElixirMonitoringProm.Repo,
55
username: "postgres",
66
password: "postgres",
77
database: "elixir_monitoring_prom_dev",
8-
hostname: "localhost",
8+
hostname: "postgres",
99
show_sensitive_data_on_connection_error: true,
1010
pool_size: 10
1111

docker-compose.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
version: '3.7'
2+
3+
services:
4+
elixir_app:
5+
image: elixir:1.9.1
6+
command: >
7+
/bin/sh -c 'apt-get update && apt-get install -y inotify-tools &&
8+
mix local.hex --force &&
9+
mix local.rebar --force &&
10+
mix deps.get &&
11+
mix ecto.setup &&
12+
mix phx.server'
13+
ports:
14+
- '4000:4000'
15+
depends_on:
16+
- postgres
17+
working_dir: /app
18+
volumes:
19+
- ./config:/app/config:ro
20+
- ./lib:/app/lib:ro
21+
- ./priv:/app/priv:ro
22+
- ./.formatter.exs:/app/formatter.exs:ro
23+
- ./mix.exs:/app/mix.exs:ro
24+
- ./mix.lock:/app/mix.lock:ro
25+
- elixir-deps:/app/deps/
26+
- elixir-build:/app/_build/
27+
28+
postgres:
29+
image: mdillon/postgis:11-alpine
30+
ports:
31+
- '5432:5432'
32+
volumes:
33+
- postgres-data:/var/lib/postgresql/data
34+
environment:
35+
POSTGRES_PASSWORD: postgres
36+
POSTGRES_USER: postgres
37+
38+
volumes:
39+
elixir-deps: {}
40+
elixir-build: {}
41+
postgres-data: {}

0 commit comments

Comments
 (0)