Skip to content

Docker containers for a phoenix application with elm and postgres.

Notifications You must be signed in to change notification settings

besuikerd/phoenix_elm

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhoenixElm

Docker containers for a phoenix application with elm and postgres

Building the docker container

To build and run the docker container, you need docker-compose. To keep the same file permission between the host and the container, the uid of the current user needs to be set. That is why the UID environment variable is exported. The following command builds the container:

export UID
docker-compose build

Setting up

app_name=some_app_name
cd app
mix deps.get
cd apps
while [ true ] ; do echo no ; done | mix phoenix.new $app_name
cd ../..
scripts/elmify/elmify.sh app/apps/$app_name

Run the container

The container can be run with docker-compose:

docker-compose up

It can be useful to also have another terminal open with a shell inside the container:

docker-compose run web bash

To set up the database, you need change the hostname in app/apps/app_name/config/dev.exs:

41  hostname: "localhost",

to

    hostname: "db"

Then you can ecto commands to initialize the database, you need to invoke them inside the container:

cd app/apps/app_name
mix ecto.create
mix ecto.migrate

About

Docker containers for a phoenix application with elm and postgres.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published