version: "3.7"

services:
  app_proxy:
    environment:
      APP_HOST: nocodb_app_1
      APP_PORT: 8080
      PROXY_AUTH_ADD: "false"

  app:
    image: nocodb/nocodb:2026.04.3@sha256:98090d707ab36ad0fe62dac8c8416b4ebf6ee939a8f851676b880b5ac159a74a
    restart: on-failure
    user: "1000:1000"
    depends_on:
      postgres:
        condition: service_healthy
    environment:
      NC_DB: "pg://nocodb_postgres_1:5432?u=nocodb&p=itworkslocally&d=nocodb"
    volumes:
      - ${APP_DATA_DIR}/data/app:/usr/app/data

  postgres:
    image: postgres:18.3-alpine@sha256:52098013b4b64a746626437d38afc03cabff6cdeb4d3d92e2342aa95f0ce56ea
    restart: on-failure
    stop_grace_period: 1m
    environment:
      POSTGRES_DB: nocodb
      POSTGRES_USER: nocodb
      POSTGRES_PASSWORD: itworkslocally
      PGDATA: /data/pgdata
    healthcheck:
      test: "pg_isready -U \"$$POSTGRES_USER\" -d \"$$POSTGRES_DB\""
      interval: 10s
      timeout: 5s
      retries: 5
      start_period: 30s
    volumes:
      - ${APP_DATA_DIR}/data/db:/data
