File tree Expand file tree Collapse file tree 3 files changed +56
-0
lines changed
Expand file tree Collapse file tree 3 files changed +56
-0
lines changed Original file line number Diff line number Diff line change 1+ FROM elixir:1.3.4
2+
3+ RUN mix local.hex --force
4+ RUN mix local.rebar --force
5+ RUN mix archive.install --force https://github.com/phoenixframework/archives/raw/master/phoenix_new.ez
6+ RUN curl -sL https://deb.nodesource.com/setup_6.x | bash -
7+ RUN apt-get install -y -q nodejs
8+
9+ WORKDIR /app
10+ ADD . /app
11+
12+ CMD mix phoenix.server
Original file line number Diff line number Diff line change 1+ version : ' 3'
2+ services :
3+ db :
4+ image : postgres:9.6-alpine
5+ web :
6+ build :
7+ context : .
8+ args :
9+ http_proxy : ${HTTP_PROXY}
10+ https_proxy : ${HTTP_PROXY}
11+ HTTP_PROXY : ${HTTP_PROXY}
12+ HTTPS_PROXY : ${HTTP_PROXY}
13+ volumes :
14+ - .:/app
15+ ports :
16+ - " 4000:4000"
17+ depends_on :
18+ - db
Original file line number Diff line number Diff line change 1+ #! /bin/sh
2+ set -e
3+ # set -o xtrace
4+
5+ function usage () {
6+ printf " " "
7+ DESCRIPTION:
8+ Create a new dockerized Phoenix project
9+ Example: ./init hello_world
10+ " " "
11+
12+ }
13+
14+ if [[ -z $1 ]]; then
15+ usage
16+ exit 1
17+ fi
18+
19+ docker-compose -p $1 up -d
20+ docker-compose -p $1 run web mix phoenix.new $1
21+ mv $1 /* ./
22+ mv $1 /.gitignore ./
23+ rm -rf $1
24+ sed -i.bak ' s/hostname: "localhost"/hostname: "db"/g' config/dev.exs && rm -f config/dev.exs.bak
25+ docker-compose -p $1 run web mix ecto.create
26+ docker-compose -p $1 restart web
You can’t perform that action at this time.
0 commit comments