FROM docker.io/thecodingmachine/php:8.4-v4-fpm-alpine

# Set working directory
WORKDIR /var/www

# Get latest Composer
COPY --from=docker.io/composer:latest /usr/bin/composer /usr/bin/composer

# Copy application files
# TheCodingMachine images default to user 'docker' (UID 1000)
COPY --chown=docker:docker . /var/www

# You can likely remove the manual chmod/chown lines 
# as this image handles them via environment variables if needed.

EXPOSE 8000

# Use the image's built-in entrypoint or your artisan command
CMD ["php", "artisan", "serve", "--host=0.0.0.0", "--port=8000"]