-
Notifications
You must be signed in to change notification settings - Fork 5
/
docker-compose.yml
48 lines (46 loc) · 1.4 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
# Source: https://pspdfkit.com/blog/2018/how-to-run-your-phoenix-application-with-docker/
# Version of docker-compose
version: '3'
# Containers we are going to run
services:
# Our Phoenix container
phoenix:
# The build parameters for this container.
image: ukasiu/pokedex
environment:
# Variable to connect to our Postgres server
# scheme ://username:password@host:port/database
DATABASE_URL: postgresql://postgres:postgres@db:5432/pokedex
# Variables for entrypoint.sh
PGHOST: db
PGPORT: 5432
PGUSER: postgres
PGDATABASE: pokedex
PGPASSWORD: postgres
ports:
# Mapping the port to make the Phoenix app accessible outside of the container
- "4000:4000"
volumes:
# Mapping for live reload
- ".:/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:10.1
environment:
# Set user/password for Postgres
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
# Set a path where Postgres should store the data
PGDATA: /var/lib/postgresql/data/pgdata
restart: always
ports:
# Mapping the port to make Postgres accessible outside of the container
- "5432:5432"
volumes:
- pgdata:/var/lib/postgresql/data
# Define the volumes
volumes:
pgdata: