Application for the management of my personal library.
My first application written in Elixir with Phoenix web framework using and Docker.
- Create the .env file. To do this, rename the file .env.dist
- If necessary, change the docker output ports. You are using "4020:4020" for Phoenix Server and "5434:5432" for Postgres (check these files: docker-file.yml and .env).
- Follow these steps:
# a. To build the container and install all the dependencies,
# create the database and run the migrations with the real data load,
# we must launch this script:
./docker_up.sh
# b. Access the container, from the console
docker exec -ti doofinder_phoenix_1 bash
# b.1. Assign permissions for the local user
chown -R 1000:1000 _build/
chown -R 1000:1000 deps/
# b.2. Install Npm dependencies
mix do deps.compile, phx.digest
- Now, you can visit
localhost:4020
from your browser. - To access the tool, you need to register on the platform.
When building the container, an alias "mix" is created to facilitate the execution of Elixir commands, so that "mix" can be invoked directly to execute commands inside the container:
alias mix="docker-compose run --rm phoenix mix"
# Without alias
docker-compose run --rm phoenix mix setup
# With alias
mix setup
# Without alias
docker-compose run --rm phoenix mix ecto.setup
# With alias
mix ecto.setup
# Without alias
docker-compose run --rm -e MIX_ENV=test phoenix mix test
# With alias
MIX_ENV=test mix test
docker exec -ti doofinder_phoenix_1 bash
docker-compose down
docker-compose restart
psql -U postgres