version: '3'

services:
  postgres:
    image: postgres
    container_name: lae_pgsql
    environment:
      POSTGRES_PASSWORD: 111111
    ports:
      - "5433:5432"
    volumes:
      - ./lae_pg_data:/var/lib/postgresql/data
      - ./init_db/create_db.sql:/docker-entrypoint-initdb.d/create_db.sql
      - ./init_db/create_table.sql:/docker-entrypoint-initdb.d/create_table.sql
      - ./init_db/insert_data.sql:/docker-entrypoint-initdb.d/insert_data.sql

  python:
    build:
      context: .
      dockerfile: Dockerfile
    image: lae_python_image:v1
    container_name: lae_python
    ports:
      - "8003:8003"
    stdin_open: true
    tty: true
    command: sh -c "cd src && python gradio_app.py"


volumes:
  lae_pg_data: