All Projects → nicbet → Docker Phoenix

nicbet / Docker Phoenix

Licence: gpl-3.0
A dockerized Phoenix development and runtime environment.

Programming Languages

elixir
2628 projects

Projects that are alternatives of or similar to Docker Phoenix

Cabot Docker
Docker Images to build full cabot environment
Stars: ✭ 75 (-50.66%)
Mutual labels:  docker-image, docker-compose
Adoptoposs
Finding co-maintainers for your open source software project.
Stars: ✭ 93 (-38.82%)
Mutual labels:  phoenix-framework, elixir-phoenix
Docker Superset
Repository for Docker Image of Apache-Superset. [Docker Image: https://hub.docker.com/r/abhioncbr/docker-superset]
Stars: ✭ 86 (-43.42%)
Mutual labels:  docker-image, docker-compose
Directus Docker
Directus 6 Docker — Legacy Container [EOL]
Stars: ✭ 68 (-55.26%)
Mutual labels:  docker-image, docker-compose
Container
HedgeDoc container image resources
Stars: ✭ 149 (-1.97%)
Mutual labels:  docker-image, docker-compose
Dockerfiles
lots of dockerfiles, based on alpine
Stars: ✭ 69 (-54.61%)
Mutual labels:  docker-image, docker-compose
Docker Multistreamer
Dockerized multistreamer
Stars: ✭ 90 (-40.79%)
Mutual labels:  docker-image, docker-compose
Phoenix In Action
Code snippets and examples from the book Phoenix in Action from Manning and Geoffrey Lessel
Stars: ✭ 60 (-60.53%)
Mutual labels:  phoenix-framework, elixir-phoenix
Dockernotes
Docker入门精华版
Stars: ✭ 107 (-29.61%)
Mutual labels:  docker-image, docker-compose
Docker Laravel
🐳 Docker Images for Laravel development
Stars: ✭ 101 (-33.55%)
Mutual labels:  docker-image, docker-compose
Firebird
Template for Phoenix 1.3 projects
Stars: ✭ 66 (-56.58%)
Mutual labels:  phoenix-framework, elixir-phoenix
Docker Workshop
Introduction to Docker tutorial
Stars: ✭ 124 (-18.42%)
Mutual labels:  docker-image, docker-compose
Poco
Poco will help you to organise and manage Docker, Docker-Compose, Kubernetes, Openshift projects of any complexity using simple YAML config files to shorten the route from finding your project to initialising it in your local environment.
Stars: ✭ 66 (-56.58%)
Mutual labels:  docker-image, docker-compose
Bareos
Docker image for Bareos
Stars: ✭ 74 (-51.32%)
Mutual labels:  docker-image, docker-compose
Shorten api tutorial
🔗How to make a link shortener using Elixir, Phoenix and Mnesia
Stars: ✭ 60 (-60.53%)
Mutual labels:  phoenix-framework, elixir-phoenix
Docker Compose Lamp
A basic LAMP stack environment built using Docker Compose.
Stars: ✭ 1,284 (+744.74%)
Mutual labels:  docker-image, docker-compose
Leanote Dockerfile
docker-compose for leanote.
Stars: ✭ 49 (-67.76%)
Mutual labels:  docker-image, docker-compose
Scala Graalvm Docker
Docker images to build and generate native artifacts using GraalVM
Stars: ✭ 60 (-60.53%)
Mutual labels:  docker-image, docker-compose
Fusionauth Containers
Container definitions for docker, kubernetes, helm, and whatever containers come next!
Stars: ✭ 101 (-33.55%)
Mutual labels:  docker-image, docker-compose
Docker
最新lnmp环境,包含php, java,nginx, mysql, go, node, mongodb, openssh server, redis, crond xhprof,maven等服务
Stars: ✭ 120 (-21.05%)
Mutual labels:  docker-image, docker-compose

Dockerized Elixir/Phoenix Development Environment

GitHub tag (latest SemVer) Docker Cloud Build Status

Introduction

I have been working on a long-running personal Phoenix project since Phoenix 1.0.2. Over the past year and a half or so, Phoenix and Elixir have undergone numerous changes, and some of them (okay most of them) broke my application code. Things really went south after I found myself working on multiple different projects that were built on different Phoenix versions. This reminded me a lot of the early Ruby and Rails days (and fighting rbenv and bundle).

This project was conceived to deal with the issues of running different Elixir and Phoenix versions and supporting the development of apps built with different Elixir and Phoenix versions.

New: Support for VS Code Remote Extension

After cloning this repository, open the folder in Visual Studio Code's Remote Extension to get a full Development Environment (with PostgreSQL Database) spun up automatically.

See https://code.visualstudio.com/docs/remote/containers for more details.

Getting Started

It's so simple: just clone this repository.

You can specify a particular Phoenix version by targeting the corresponding release tag of this repository.

For instance, for a dockerized development environment for Phoenix 1.5.8 you could run:

git clone -b 1.5.8 https://github.com/nicbet/docker-phoenix ~/Projects/hello-phoenix

New with Elixir 1.9: Releases

Follow this [Github Gist] (https://gist.github.com/nicbet/102f16359828405ce34ca083976986e1) to prepare a minimal Docker release image based on Alpine Linux (about 38MB for a Phoenix Webapp).

New Application from Scratch

Navigate the to where you cloned this repository, for example:

cd ~/Projects/hello-phoenix

Initialize a new phoenix application. The following command will create a new Phoenix application called hello under the src/ directory, which is mounted inside the container under /app (the default work dir).

./mix phx.new . --app hello

Why does this work? The docker-compose.yml file specifies that your local src/ directory is mapped inside the docker container as /app. And /app in the container is marked as the working directory for any command that is being executed, such as mix phoenix.new.

NOTE: It is important to specify your app name through the --app <name> option, as Phoenix will otherwise name your app from the target directory passed in, which in our case is .

NOTE: It is okay to answer Y when phoenix states that the /app directory already exists.

NOTE: Starting from 1.3.0 the mix phoenix.new command has been deprecated. You will have to use the phx.new command instead of phoenix.new or mix deps.get will fail!

Alternative: Existing Application

Copy your existing code Phoenix application code to the src/ directory in the cloned repository.

NOTE: the src/ directory won't exist so you'll have to create it first.

Database

Preparation

The docker-compose.yml file defines a database service container named db running a PostgreSQL database that is available to the main application container via the hostname db. By default Phoenix assumes that you are running a database locally.

Modify the Ecto configuration src/config/dev.exs to point to the DB container:

# Configure your database
config :test, Test.Repo,
  adapter: Ecto.Adapters.Postgres,
  username: "postgres",
  password: "postgres",
  database: "test_dev",
  hostname: "db",
  pool_size: 10

Initialize the Database with Ecto

When you first start out, the db container will have no databases. Let's initialize a development DB using Ecto:

./mix ecto.create

If you copied an existing application, now would be the time to run your database migrations.

./mix ecto.migrate

Starting the Application

Starting your application is incredibly easy:

docker-compose up

Once up, it will be available under http://localhost:4000

Notes

Executing custom commands

To run commands other than mix tasks, you can use the ./run script.

./run iex -S mix
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].