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
        environment:
            - debug=yes
    frontend:
        build: ./frontend/.
        image: banjocat/calorie_find_frontend:latest
        volumes:
            - ./frontend/html/:/usr/share/nginx/html
        ports:
            - "8000:80"
        depends_on:
            - backend
    # 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
        build: ./db/.
        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
        environment:
            - debug=yes
    frontend:
        build: ./frontend/.
        image: banjocat/calorie_find_frontend:latest
        volumes:
            - ./frontend/html/:/usr/share/nginx/html
        ports:
            - "8000:80"
        depends_on:
            - backend
    # 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: banjocat/calorie_find_db:latest
        build: ./db/.
        environment:
            - POSTGRES_USER=food
            - POSTGRES_PASSWORD=food


Fix image name of db
Fix image name of db
