version: '2'

services:

  proxy:
    image: guysoft/ownphotos-proxy
    tty: true
    container_name: ownphotos-proxy
    restart: always
    links:
      - "backend:backend"
      - "frontend:frontend"
    ports:
      - "3333:80"
      
  ownphotos-db:
    image: postgres
    container_name: ownphotos-db
    restart: always
    environment:
    # This db password is internal, you can change it if you want, but also change it in ownphotos-backend container
      - POSTGRES_PASSWORD=AaAa1234
      - POSTGRES_DB=ownphotos
    volumes:
      - ownphotos-data:/var/lib/postgresql/data

  frontend:
    container_name: ownphotos-frontend
    image: guysoft/ownphotos-frontend:dev
    tty: true
    environment:
       # This is the path to the backend host public facing. if your website is ownphotos.org then this should be "ownphotos.org".
       # Default here is assuming you are running on localhost on port 3000 as given in ownphotos-proxy service
       - BACKEND_HOST=localhost:3333
    links:
      - "backend:backend"

  backend:
    image: hooram/ownphotos:dev
    # For development uncomment this and comment the image name above
    #build: .
    container_name: ownphotos-backend
    volumes:
      # Your photos go here
      - ./Pictures/:/data
      - ./ownphotos_media:/code/protected_media
    environment:
      - SECRET_KEY=change_meme
      # This is backend host from within the service, you dont need to change this
      - BACKEND_HOST=backend
      - ADMIN_EMAIL=admin@example.com
      - ADMIN_USERNAME=admin
      # Change your admin password!
      - ADMIN_PASSWORD=admin
      - DEBUG=true
      - DB_BACKEND=postgresql
      - DB_NAME=ownphotos
      - DB_USER=postgres
      # This db password is internal, you can change it if you want, but also change it in ownphotos-db container
      - DB_PASS=AaAa1234
      - DB_HOST=ownphotos-db
      - DB_PORT=5432
      - REDIS_HOST=ownphotos-redis
      - REDIS_PORT=6379
      - MAPBOX_API_KEY=CHANGE_MEAAAA
      - TIME_ZONE=UTC
    links:
      - "ownphotos-db:ownphotos-db"
      - "ownphotos-redis:ownphotos-redis"
  
  ownphotos-redis:
    image: redis
    container_name: ownphotos-redis

volumes:
  ownphotos-data:
  media: