https://www.theanglingatlas.com
- Install Docker for Mac
- In one terminal tab:
docker-compose builddocker-compose up
- In a second tab, once the two commands in the first tab are completed:
docker-compose exec web mix ecto.setup
- If everything spins up with no errors, site will be live at localhost:4000
- The
seeds.exsfile is executed in theecto.setupmixcommand, in the steps above - If the seeds need to be run again, it can be done with the following command:
docker-compose exec web mix run priv/repo/seeds.exs
When executing a command with docker-compose it can be run with either run or exec.
From the docs:
- The docker
runcommand first creates a writeable container layer over the specified image, and thenstartsit using the specified command- If using
run, adding the--rmflag will automatically remove the container when the command is finished
- If using
- The docker
execcommand runs a new command in a running container
References: https://docs.docker.com/engine/reference/commandline/run/ https://docs.docker.com/engine/reference/commandline/exec/
With the project running on Docker, the standard iex -S mix will not work to spin up an iEX console. An updated command, that works with Docker is:
docker-compose exec web iex -S mix
This command will maintain history from one iEX shell to another:
docker-compose exec web iex --erl "-kernel shell_history enabled" -S mix
With the project running on Docker tests can be run with:
docker-compose exec web mix test
To run only a specific test file:
docker-compose exec web mix test test/<path to file>
To run only a specific test within a test file:
docker-compose exec web mix test test/<path to file>:<test line number>
Hosted by Gigalixir, docs can be found here
- It should be noted that the docs are very good, and searchable
- Once the CLI is installed,
gigalixir helpis also very detailed
brew tap gigalixir/brew && brew install gigalixir
gigalixir login
gigalixir account
- Navigate to project folder
gigalixir git:remote atlas
git remote -v
git remote rename gigalixir staging
- Any branch can be pushed to the staging site
- Branches need to be pushed to Github before being pushed to staging
git push staging <branch name>:master
- This project's main branch is named
main, but Gigalixir is expecting it to be namedmaster- Because of this, when pushing
mainto staging, it cannot be done with the shorthand:git push staging master - Until a fix is made by Gigalixir, the following syntax must be used to push:
git push staging main:master
- Because of this, when pushing
- This can be used to run a shell command as a job in a separate container
gigalixir run ...
- Any
mixcommand available locally can be executing on staging utilizingrun gigalixir run mix <command here>
gigalixir run mix ecto.migrate- The logs do not automatically show, to view the logs
gigalixir logs
gigalixir run -- mix run priv/repo/seeds.exs
gigalixir ps:remote_console
gigalixir open
- 20210901 renewed the name.com domain and then the SSL (https) was not available
- The fix
- delete and reset the
wwwdomain - removed the domain via the dashboard
gigalixir domains:add www.theanglingatlas.com- the
wwwdomain points totheanglingatlas.comas aCNAMEvia name.com
- delete and reset the