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: "."
$ MIX_ENV=prod mix compile
$ MIX_ENV=prod mix release --env=prod
$ sudo -E VERSION=0.0.1 docker-compose build --force-rm
$ docker-compose up