-
Notifications
You must be signed in to change notification settings - Fork 1
/
docker-compose.yml
52 lines (50 loc) · 1.33 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
# Version of docker-compose
version: '3'
# Containers we are going to run
services:
# Our Phoenix container
phoenix:
# The build parameters for this container.
build:
# Here we define that it should build from the current directory
context: .
environment:
# Variables to connect to our Postgres server
PGUSER: dev
PGPASSWORD: dev123
PGDATABASE: smart_bank_dev
PGPORT: 5432
# Hostname of our Postgres container
PGHOST: db
ports:
# Mapping the port to make the Phoenix app accessible outside of the container
- "4000:4000"
volumes:
- ../../:/opt/app
depends_on:
# The db container needs to be started before we start this container
- db
db:
# We use the predefined Postgres image
image: postgres:9.6
environment:
# Set user/password for Postgres
POSTGRES_USER: dev
POSTGRES_PASSWORD: dev123
# Set a path where Postgres should store the data
PGDATA: /var/lib/postgresql/data/pgdata
restart: always
volumes:
- pgdata:/var/lib/postgresql/data
# Setup database for testing
postgres_test:
image: postgres:9.6
ports:
- "5432:5432"
environment:
POSTGRES_DB: smart_bank_test
POSTGRES_USER: dev
POSTGRES_PASSWORD: dev123
# Define the volumes
volumes:
pgdata: