├── Dockerfile ├── LICENSE └── README.md /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:latest 2 | 3 | RUN locale-gen en_US.UTF-8 4 | ENV LANG en_US.UTF-8 5 | ENV LANGUAGE en_US:en 6 | ENV LC_ALL en_US.UTF-8 7 | 8 | RUN apt-get update && apt-get upgrade -y && apt-get install -y curl wget git make 9 | RUN wget http://packages.erlang-solutions.com/erlang-solutions_1.0_all.deb \ 10 | && dpkg -i erlang-solutions_1.0_all.deb \ 11 | && apt-get update 12 | 13 | RUN apt-get install -y elixir erlang-dev erlang-parsetools && rm erlang-solutions_1.0_all.deb 14 | 15 | ENV PHOENIX_VERSION 1.1.4 16 | 17 | RUN mix archive.install --force https://github.com/phoenixframework/archives/raw/master/phoenix_new-$PHOENIX_VERSION.ez 18 | 19 | RUN curl -sL https://deb.nodesource.com/setup_5.x | bash - 20 | 21 | RUN apt-get install -y nodejs 22 | 23 | WORKDIR / 24 | 25 | RUN mix phoenix.new blog 26 | 27 | WORKDIR blog 28 | 29 | RUN mix local.hex --force 30 | RUN mix local.rebar 31 | RUN mix deps.get 32 | 33 | RUN npm install && npm install --save-dev babel-cli babel-preset-es2015 34 | 35 | RUN echo '{ "presets": ["es2015"] }' > .babelrc 36 | 37 | EXPOSE 4000 38 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Ahmet Simsek 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # phoenix-docker 2 | Phoenix Framework dockerfile 3 | 4 | ### clone phoenix-docker 5 | git clone https://github.com/indatawetrust/phoenix-docker.git && cd phoenix-docker 6 | 7 | ### build image 8 | sudo docker build -t phoenix-docker . 9 | 10 | ### run container 11 | sudo docker run -it -p 4000:4000 --name server phoenix-docker 12 | 13 | ### start container 14 | sudo docker start server 15 | 16 | ### container bash 17 | sudo docker exec -it server bash 18 | 19 | ### start phoenix server 20 | elixir --detached -S mix phoenix.server 21 | 22 | ![localhost:4000](http://i.hizliresim.com/nMo9ZV.png) 23 | --------------------------------------------------------------------------------