version: '2'
services:
    backend:
        build: ./backend/.
        image: banjocat/calorie_find:latest
        restart: always
        depends_on:
            - db
        command: bash -c "/tmp/wait-for-it.sh -h db -p 5432 && ./manage.py runserver 0.0.0.0:8000"
        volumes:
            - ./backend/calorie_find:/opt/api
        ports: 
            - "8020:8000"
    # Setups database
    fixture:
        build: ./backend/.
        image: banjocat/calorie_find:latest
        depends_on:
            - db
        command: |
            bash -c "\
            /tmp/wait-for-it.sh -h db -p 5432 && \
            ./manage.py makemigrations && \
            ./manage.py migrate && \
            ./manage.py loaddata calories/fixtures/food.json"

    db:
        image: postgres:9
        environment:
            - POSTGRES_USER=food
            - POSTGRES_PASSWORD=food


version: '2'
services:
    backend:
        build: ./backend/.
        image: banjocat/calorie_find:latest
        restart: always
        depends_on:
            - db
        command: bash -c "/tmp/wait-for-it.sh -h db -p 5432 && ./manage.py runserver 0.0.0.0:8000"
        volumes:
            - ./backend/calorie_find:/opt/api
        ports: 
            - "8020:8000"
    # Setups database
    fixture:
        build: ./backend/.
        image: banjocat/calorie_find:latest
        depends_on:
            - db
        command: |
            bash -c "\
            /tmp/wait-for-it.sh -h db -p 5432 && \
            ./manage.py makemigrations && \
            ./manage.py migrate && \
            ./manage.py loaddata calories/fixtures/food.json && \
            echo Database migrations done!!"

    db:
        image: postgres:9
        environment:
            - POSTGRES_USER=food
            - POSTGRES_PASSWORD=food


Add done message to migrations
Add done message to migrations
