version: '3'
services:
  workify-nginx:
    image: nginx:latest
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./docker-files/sites-enabled:/etc/nginx/conf.d
      - ./:/var/www/app
      - ./docker-files/logs/nginx:/var/log/nginx
    networks:
      workify-net:
        aliases:
          - workify.local
          - cabinet.workify.local
          - crm.workify.local
          - api.workify.local
    depends_on:
      - workify-app
    command: [ nginx-debug, '-g', 'daemon off;' ]
    container_name: workify-nginx
  workify-app:
    build: ./docker-files/
    volumes:
      - ./:/var/www/app
    networks:
      - workify-net
    depends_on:
      - workify-db
    container_name: workify-app
  workify-db:
    image: postgres:14.1-alpine
    container_name: workify-db
    ports:
      - '5432:5432'
    environment:
      POSTGRES_PASSWORD: 'postgres'
      POSTGRES_DB: 'workify'
    volumes:
      - workify-volume-pgsql:/var/lib/postgresql/data
      - ./docker-files/dumps:/var/mysql-dumps
    networks:
      - workify-net
    restart: always
networks:
  workify-net:
    driver: bridge
volumes:
  workify-volume-pgsql:
    driver: local