Skip to content

Instantly share code, notes, and snippets.

@zedtux
Created November 24, 2017 14:21
Show Gist options
  • Save zedtux/504d853297cf185108dd0e595910ed01 to your computer and use it in GitHub Desktop.
Save zedtux/504d853297cf185108dd0e595910ed01 to your computer and use it in GitHub Desktop.
Docker compose file with a data container for the Elixir/Phoenix "deps" folder
version: '2'
services:
# Application database
db:
image: postgres
ports:
- "5432:5432"
volumes:
- ./db:/var/lib/postgresql
# Dependencies caching
app_deps:
image: <name of your image here>
command: echo Mix data container
volumes:
- /deps
# Elixir Phoenix application
app:
build: .
command: mix phx.server
environment:
- PORT=4000
- PG_HOST=db
- PG_USERNAME=postgres
ports:
- 4000:4000
links:
- db
volumes_from:
- app_deps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment