Skip to content

dhslr/recipes_backend

Repository files navigation

RecipesBackend

To start your Phoenix server locally:

  • Setup the project with mix setup
  • Start Phoenix endpoint with mix phx.server

Now you can visit localhost:4000 from your browser.

Build with docker

This project contains a Dockerfile to build and deploy the application in a docker container.

Build the image

docker build . --tag recipes_backend:0.0.1

Run the image

Before you run the image, make sure to pass the required environment configuration variables. You can create a .env file with the following content:

DATABASE_URL=ecto://<username>:<password>@<hostname>/<db_name>
SECRET_KEY_BASE=<key generated with mix phx.gen.secret>

Replace the values matching your environment. Then run

docker run -p 4000:4000 --env-file=.env --rm recipes_backend:0.0.1 bin/recipes_backend start

For more information check the phoenix deployment guides.

Docker-compose

You can also use docker-compose which automatically respects the .env file.

docker-compose up -d
docker-compose  run --rm app bin/recipes_backend eval "RecipesBackend.Release.migrate"

Backup

docker-compose run --rm -e PGPASSWORD="postgres" db /usr/bin/pg_dump -h db --no-owner -U postgres recipes --no-password > dump.sql
docker-compose run --rm -e PGPASSWORD="postgres" db /usr/bin/psql -h db -U postgres recipes < dump.sql

API Docs

API docs can be found in API. The docs are generated when

Learn more

About

Elixir backend for my recipes app

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published