To start your Phoenix server:
- Run
mix setupto install and setup dependencies - Start Phoenix endpoint with
mix phx.serveror inside IEx withiex -S mix phx.server
Now you can visit localhost:4000 from your browser.
Ready to run in production? Please check our deployment guides.
- Official website: https://www.phoenixframework.org/
- Guides: https://hexdocs.pm/phoenix/overview.html
- Docs: https://hexdocs.pm/phoenix
- Forum: https://elixirforum.com/c/phoenix-forum
- Source: https://github.com/phoenixframework/phoenix
sudo apt update sudo apt install nano -y
sudo fallocate -l 10G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile sudo nano /etc/fstab /swapfile none swap sw 0 0
sudo apt install -y curl jq
sudo apt install -y ca-certificates curl gnupg lsb-release
sudo mkdir -p /etc/apt/keyrings curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo "deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
| sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt update sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo usermod -aG docker $USER
docker compose up -d
docker build -t hello_phoenix . docker run -it --rm -p 4000:4000 -e SECRET_KEY_BASE="KmsyXpjWSJXsF8yVCf7oehu3YXYJSyi6NzEmdpIdl6OXu+PD7gLtjH0Oe0AnyXGN" hello_phoenix
docker tag hello_phoenix:latest daviaws/hello_phoenix:0.1.5 docker push daviaws/hello_phoenix:0.1.5
sudo docker run -d
--network traefik_network
--env-file .env
--label traefik.enable=true
--label traefik.http.routers.phx.entrypoints=web
--label 'traefik.http.routers.phx.rule=Host(localhost)'
--label traefik.http.services.phx.loadbalancer.server.port=4000
-v data:/app/data
daviaws/hello_phoenix:0.1.5
sudo docker run -d
--network traefik_network
-e PHX_HOST="$(curl -s https://ifconfig.me)"
--env-file .env
--label traefik.enable=true
--label traefik.http.routers.phx.entrypoints=web
--label "traefik.http.routers.phx.rule=Host(`localhost`) || Host(`$(curl -s https://ifconfig.me)\`)"
--label traefik.http.services.phx.loadbalancer.server.port=4000
-v /home/ubuntu/data:/app/data
daviaws/hello_phoenix:0.1.5
curl http://152.67.34.232
eval