Sign inSign up

globz/recipes-backend

By globz

Updated over 5 years ago

Image
0

1.9K

globz/recipes-backend repository overview

Recipes Backend

Build Status

Backend for Recipes

Development setup

  • Setup database
docker run --rm --name recipes_postgres -e POSTGRES_PASSWORD=$POSTGRES_PASSWORD -p 5432:5432 -d postgres
  • Run tests
python manage.py test --parallel

Run backend

  • Create Docker network
docker network create recipes-backend
  • Build recipes-backend
cd docker
docker build -t globz/recipes-backend .
  • Run database with persistent data
docker run --rm --name recipes-postgres -e POSTGRES_PASSWORD=$POSTGRES_PASSWORD -e APP_USER=$APP_USER -e APP_DB=$APP_DB -e APP_USER_PASSWORD=$APP_USER_PASSWORD --network recipes-backend -p 5432:5432 -v $PWD/database:/var/lib/postgresql/data -d globz/postgres
  • Collect static
docker run --rm --name recipes-collect-static -e SECRET_KEY=$SECRET_KEY -e ALLOWED_HOST=$ALLOWED_HOST -e FRONTEND_HOST=$FRONTEND_HOST -e DB_HOST=$DB_HOST -e APP_USER=$APP_USER -e APP_DB=$APP_DB -e APP_USER_PASSWORD=$APP_USER_PASSWORD -v $PWD/static:/usr/src/app/static globz/recipes-backend -c
  • Run backend uwsgi
docker run --rm --name recipes-backend --network recipes-backend -e SECRET_KEY=$SECRET_KEY -e ALLOWED_HOST=$ALLOWED_HOST -e FRONTEND_HOST=$FRONTEND_HOST -e DB_HOST=$DB_HOST -e APP_USER=$APP_USER -e APP_DB=$APP_DB -e APP_USER_PASSWORD=$APP_USER_PASSWORD -p 3031:3031 globz/recipes-backend -r
  • Run backend nginx proxy
docker run --rm --name recipes-backend-nginx --network recipes-backend -p 8000:80 -e APP_HOST=$APP_HOST -e APP_PORT=3031 -e APP_NAME=$APP_NAME -v $PWD/static:/usr/nginx/html/recipes-backend/static globz/nginx-uwsgi-gateway

Tag summary

Content type

Image

Digest

Size

374.5 MB

Last updated

about 6 years ago

docker pull globz/recipes-backend