services:
  timelapse-api:
    build:
      context: .
      dockerfile: Dockerfile
    container_name: timelapse-api
    ports:
      - "3000:3000"
    volumes:
      - ./:/backend
      - ./storage:/storage
      - node_modules:/backend/node_modules
    environment:
      - NODE_VERSION=22.9.0
      - YARN_VERSION=1.22.22
    working_dir: /backend
    restart: always
    networks:
      - bridge
  timelapse-db:
    image: postgres:14
    container_name: timelapse-db
    ports:
      - "5432:5432"
    volumes:
      - /home/timelapse/db:/var/lib/postgresql/data
    environment:
      - POSTGRES_USER=postgres
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_DB=timelapse
    restart: always
    networks:
      - bridge

networks:
  bridge:
    driver: bridge

volumes:
  node_modules: