services: db: image: postgres:16 env_file: - .env ports: - "${PGPORT}:${PGPORT}" volumes: - postgres-db:/var/lib/postgresql/data environment: - POSTGRES_USER=${PGUSER} - POSTGRES_PASSWORD=${PGPASSWORD} - POSTGRES_DB=${PGDATABASE} api: build: context: ./api dockerfile: Dockerfile env_file: - .env ports: - "${SERVER_PORT}:${SERVER_PORT}" volumes: - api:/usr/src/app depends_on: - db command: ./bin/api migrator: build: context: ./migrator dockerfile: Dockerfile env_file: - .env depends_on: - api - db volumes: - goose:/migrations command: goose up spa: build: context: ./spa dockerfile: Dockerfile env_file: - .env ports: - "${OUTERPORT}:${INNERPORT}" depends_on: - api - db - migrator volumes: api: postgres-db: goose: