Current section

Files

Jump to
raxx_kit priv template docker-compose.yml.eex
Raw

priv/template/docker-compose.yml.eex

<%= if @docker do %>version: '2'
services:
<%= @name %>:
build:
context: "."
dockerfile: "Dockerfile"
<%= if @ecto do %>depends_on:
- db
environment:
- "DATABASE_URL=ecto://<%= @ecto.db_username %>:<%= @ecto.db_password %>@db:5432/<%= @ecto.db_name %>?ssl=false&pool_size=10"
<% end %>ports:
- 8080:8080
- 8443:8443
volumes:
- .:/opt/app
## uncomment the below lines if you want to see the contents of the
## container's deps/ and _build/ directories in your local project,
## under container_mix
# - ./container_mix_artifacts:/opt/mix_artifacts
<%= if @ecto do %>
db:
image: "postgres:9.6.11"
environment:
- POSTGRES_USER=<%= @ecto.db_username %>
- POSTGRES_PASSWORD=<%= @ecto.db_password %>
ports:
- 6543:5432<% end %>
<% end %>