-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
53 lines (50 loc) · 1.49 KB
/
docker-compose.yml
File metadata and controls
53 lines (50 loc) · 1.49 KB
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
# Version of docker-compose.
version: '3'
# Containers we're 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: .
args:
- MIX_ENV=prod
environment:
# Variables to connect to our Postgres server.
DB_USER: postgres
DB_PASSWORD: postgres
DB_NAME: arke-test
DB_HOSTNAME: db
DB_PORT: 5432
PGUSER: postgres
PGPASSWORD: postgres
PGDATABASE: arke-test
PGPORT: 5432
PGHOST: db
MIX_ENV: prod
SECRET_KEY_BASE: change_me
ports:
# Mapping the port to make the Phoenix app accessible outside of the container.
- '4000:4000'
depends_on:
# The DB container needs to be started before we start this container.
- db
db:
# We use the predefined Postgres image.
image: postgres:14.4
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 the Phoenix app accessible outside of the container.
- '5432:5432'
volumes:
- pgdata:/var/lib/postgresql/data
# Define the volumes.
volumes:
pgdata: