Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
92 changes: 47 additions & 45 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,55 @@
# Version of docker-compose.
version: '3'
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
# 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
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
PROJECT_ID: ${PROJECT_ID}

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:
pgdata: