Skip to content

Instantly share code, notes, and snippets.

@agate
Last active May 24, 2018 18:28
Show Gist options
  • Save agate/7ced4be7ead6620145ad7fa51383342a to your computer and use it in GitHub Desktop.
Save agate/7ced4be7ead6620145ad7fa51383342a to your computer and use it in GitHub Desktop.
Phoenix Docker Dev Env

Init

$ docker-compose build
$ docker volume create --name=phoenix.postgres
$ docker network create phoenix
$ docker-compose up -d postgres

Start Phoenix Docker Container

$ docker-compose run --service-ports phoenix bash
version: '3'
networks:
default:
external:
name: phoenix
volumes:
phoenix.postgres:
services:
postgres:
image: postgres:9.6
volumes:
- phoenix.postgres:/var/lib/postgresql/data
phoenix:
build: .
ports:
- 4000:4000
volumes:
- .:/workspace
FROM elixir:1.6
RUN \
echo "===============================" && \
echo "Install Node" && \
echo "===============================" && \
curl -sL https://deb.nodesource.com/setup_8.x | bash - && \
apt-get install -y nodejs && \
echo "===============================" && \
echo "Install Phoenix" && \
echo "===============================" && \
mix archive.install --force https://github.com/phoenixframework/archives/raw/master/phx_new.ez
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment