-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose.yml
66 lines (60 loc) · 1.52 KB
/
docker-compose.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
version: '3'
x-app: &app
build:
context: .
dockerfile: .docker/Dockerfile
args:
ELIXIR_VERSION: ${ELIXIR_VERSION}
ERLANG_VERSION: ${ERLANG_VERSION}
ALPINE_VERSION: ${ALPINE_VERSION}
NODE_VERSION: ${NODE_VERSION}
POSTGRES_VERSION: ${POSTGRES_VERSION}
environment: &env
MIX_ENV: ${MIX_ENV}
image: elixir-on-whales:2.0.0
tmpfs:
- /tmp
x-backend: &backend
<<: *app
stdin_open: true
tty: true
volumes:
- .:/app:cached
- mix:/root/.mix
- hex:/root/.hex
- node_modules:/app/assets/node_modules
- .docker/.psqlrc:/root/.psqlrc:ro
- ./log/.erlang-history:/root/.cache/erlang-history
environment:
<<: *env
DATABASE_URL: postgres://postgres:${POSTGRES_PASSWORD}@postgres:5432/app_${MIX_ENV}
HISTFILE: /app/log/.shell_history
PSQL_HISTFILE: /app/log/.psql_history
DISPLAY: ${X_WINDOWS_ADDRESS}:0
EDITOR: vi
ERL_AFLAGS: -kernel shell_history enabled
services:
shell:
<<: *backend
command: /bin/sh
phoenix:
<<: *backend
command: /bin/sh -c "test -f /app/_build/dev/lib/phoenix/ebin/Elixir.Mix.Phoenix.beam && mix phx.server"
ports:
- 4000:4000
postgres:
image: postgres:${POSTGRES_VERSION}-alpine
volumes:
- postgres:/var/lib/postgresql/data
- .docker/.psqlrc:/root/.psqlrc:ro
- ./log:/root/log:cached
environment:
PSQL_HISTFILE: /root/log/.psql_history
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
ports:
- 5432:5432
volumes:
mix:
hex:
node_modules:
postgres: