services:  
  postgresql:
    container_name: "photonicat_postgresql"
    image: postgres:9.5-alpine
    ports:
      - "5432"
    restart: always  
    environment:
      - POSTGRES_HOST_AUTH_METHOD=trust
    volumes:
      - ./data/postgresql:/var/lib/postgresql/data

  redis:
    container_name: "novotech_redis"
    image: redis:4-alpine
    ports:
      - "6379"
    restart: always  
    volumes:
      - ./data/redis:/data
      - ./etc/redis.conf:/etc/redis.conf
    command: redis-server /etc/redis.conf

  app: &app_base
    container_name: "photonicat_app"
    image: photonicat/photonicat-www:main-latest
    env_file:
      - app.local.env
    links:
      - postgresql
      - redis
    logging:
      options:
        max-size: "1g"
        max-file: "10"
    volumes:
      - ./data/uploads:/home/app/photonicat/public/uploads
      - ./shared/cache/uploads-thumb:/home/app/photonicat/cache/uploads-thumb      
      - ./log:/home/app/photonicat/log      
      - ./tmp:/home/app/photonicat/tmp      
    command: /home/app/photonicat/bin/docker-start.sh
    ports:
      - "7000:7000"
    restart: always  
