name: ucetnik
services:
  database:
    image: postgres:14.5
    container_name: ucetnik_database
    restart: always
    environment:
      POSTGRES_DB: ucetnik
      POSTGRES_USER: postgres
      POSTGRES_PASSWORD: pass*71
    volumes:
      - ./.docker/db/dump.sql:/docker-entrypoint-initdb.d/dump.sql
      - ./dbdata:/var/lib/postgresql/data
    ports:
      - "5445:5432"

  backend:
    build:
      context: ./
      dockerfile: ./.docker/php/Dockerfile
    image: 4jm/ucetnik-php-apache-1.11
    container_name: ucetnik_backend
    ports:
      - "8088:80"
    volumes:
      - .:/var/www/html/ucetnik
    environment:
      - PHP_EXTENSION=mbstring,pdo_pgsql,pgsql,bz2,curl,fileinfo,gd,gettext,intl,imap,exif,xdebug
    restart: always
    depends_on:
      - database
