IljaN / phoenix_docker_ubuntu

Phoenix with Docker, Postgres and Distillery

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Phoenix Docker

Basic Docker setup for Phoenix + Postgres apps which are deployed using Distillery.

  • Change APP_NAME in docker-compose.yml to something like my_app (ideally name of project dir)
  • Install and configure Distillery for your project
  • Change your prod.exs and dev.exs to use PORT env variable
config :docker_test, DockerTest.Endpoint,
http: [port: {:system, "PORT"}],
url: [host: "localhost", port: {:system, "PORT"}],
cache_static_manifest: "priv/static/manifest.json",
server: true,
root: "."

Compile Release

$ MIX_ENV=prod mix compile
$ MIX_ENV=prod mix release --env=prod

Build

$ sudo -E VERSION=0.0.1 docker-compose build --force-rm

Run

$ docker-compose up

About

Phoenix with Docker, Postgres and Distillery