You will need to install Docker.
Here are some direct links if you're on Mac OS X or Windows.
Follow those download instructions. Once you can run the docker command, you can safely move on.
You'll want to clone this repository with git clone https://github.com/code-corps/code-corps-phoenix.git.
The directory structure will look like the following:
code-corps-phoenix/ # → Root folder for this project
├── blueprint/
├── config/
├── ... # → More standard Phoenix files
├── docker-compose.yml # → Compose file for configuring Docker containers
└── Dockerfile # → Creates base Ruby Docker containerNote: We bind to ports 49235 for
web, 49236 fortest, and 8081 forapiary. Make sure you're not running anything on those ports. We do not expose port 5432 forpostgresor 9200 forelasticsearch.
Go to the code-corps-phoenix directory and copy the .env.example file:
cd code-corps-phoenix
cp .env.example .env
Now, you can initialize docker, type:
docker-compose build
docker-compose upYou should now see a lot of output from the Docker processes and will not be able to interact with that terminal window.
Docker will set up your base Elixir container, as well as containers for:
postgreselasticsearchwebrunsmix do ecto.create, ecto.migrate, phoenix.servertestrunsmix testapiaryruns an Apiary client server on port8081
You can view more detailed information about these services in the docker-compose.yml file, but you shouldn't need to edit it unless you're intentionally contributing changes to our Docker workflow.
Point your browser (or make a direct request) to http://api.localhost:49235/users. You'll get the following response:
{
"jsonapi": {
"version": "1.0"
},
"data": []
}Now that you're set up, you should read more about how to develop with the API.
Having trouble?
Create an issue in this repo and we'll look into it.
Docker's a bit new for us, so there may be some hiccups at first. But hopefully this makes for a less painful developer environment for you in the long run.