-
Notifications
You must be signed in to change notification settings - Fork 7
/
docker-compose.yml
49 lines (48 loc) · 1.34 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
# Version of docker-compose
version: '3.2'
# 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: .
dockerfile: ./docker/Dockerfile
environment:
# Variables to connect to our Postgres server
POSTGRES_USER: postgres
POSTGRES_PASSWORD: thepostgrespassword
POSTGRES_DB: easypodcasts_dev
PGHOST: db
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:
- type: bind
source: .
target: /app
depends_on:
# The db container needs to be started before we start this container
- db
command:
- ./docker/run.sh
db:
# We use the predefined Postgres image
image: postgres:12.0-alpine
environment:
# Set user/password for Postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: thepostgrespassword
POSTGRES_DB: easypodcasts_dev
# Set a path where Postgres should store the data
PGDATA: /var/lib/postgresql/data/pgdata
restart: always
volumes:
- pgdata:/var/lib/postgresql/data
# Define the volumes
volumes:
pgdata: