pedroeagle/Trabalho-Individual-2020-2

View on GitHub
docker-compose.yml

Summary

Maintainability
Test Coverage
version: '3'

services:
    postgres:
        image: postgres:13
        restart: unless-stopped
        ports:
            - "5432:5432"
        volumes:
            - postgres:/var/lib/postgresql/data
            - ./api/init_db.sql:/docker-entrypoint-initdb.d/init_db.sql
        env_file:
            - .env
    front:
        build:
            context: client/
            dockerfile: Dockerfile
        volumes:
            - ./client/coverage-final.json:/usr/src/app/test/jest/coverage/coverage-final.json
        ports:
            - 8080:8080
        command: "quasar dev"
        depends_on: 
            - postgres
        env_file:
            - .env
    back:
        build:
            context: api/
            dockerfile: Dockerfile
        volumes:
            - ./api:/api
        ports:
            - 8000:8000
        command: bash -c 'python3 manage.py migrate && python3 manage.py runserver 0.0.0.0:8000'
        depends_on:
            - postgres
        env_file:
            - .env

volumes:
    postgres: