- Use fully qualified image names for clarity - Remove manual PHP extension installation as base image likely includes them - Leverage COPY --chown to set permissions directly - Remove redundant permission fix commands - Keep same final command and exposed port
19 lines
580 B
Docker
19 lines
580 B
Docker
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"] |