FROM php:8.2-cli

WORKDIR /opt/truckwash-edge-agent

RUN set -eux; \
    php -r 'foreach (["curl", "sqlite3"] as $extension) { if (!extension_loaded($extension)) { fwrite(STDERR, "Missing PHP extension: {$extension}\n"); exit(1); } }'

COPY services/nginx/app/resources/edge-gateway-agent/ ./

ENTRYPOINT ["php", "/opt/truckwash-edge-agent/agent.php"]
CMD ["--config", "/config/test-gateway.json"]
