Rumah > Artikel > pangkalan data > [Docker] Laravel, Nginx MySQL
Dockerización
Uso
Konfigurasi
Fail Docker
FROM php:8.2-fpm-alpine # Update app RUN apk update && apk add --no-cache tzdata # Set timezone ENV TZ="UTC" RUN apk add --update --no-cache autoconf g++ make openssl-dev RUN apk add libpng-dev RUN apk add libzip-dev RUN docker-php-ext-install gd RUN docker-php-ext-install zip RUN docker-php-ext-install bcmath RUN docker-php-ext-install sockets RUN curl -sS https://getcomposer.org/installer | php -- --install-dir=/usr/local/bin --filename=composer ### End Init install # Install Redis RUN pecl install redis RUN docker-php-ext-enable redis # Install Mongodb RUN pecl install mongodb RUN docker-php-ext-enable mongodb RUN docker-php-ext-install mysqli pdo pdo_mysql && docker-php-ext-enable pdo_mysql WORKDIR /home/source/main
docker-compose.yml
version: '3.7' services: mysql: image: mysql:latest container_name: mysql platform: linux/x86_64 ports: - "3306:3306" volumes: - mysql-volumes:/var/lib/mysql environment: MYSQL_ROOT_PASSWORD: laravelroot MYSQL_DATABASE: db_nginx laravel-app: build: context: ./docker/php container_name: laravel-app volumes: - ./laravel/:/home/source/main working_dir: /home/source/main nginx: build: context: ./docker/nginx container_name: todo-nginx ports: - "8000:80" depends_on: - laravel-app volumes: - ./laravel/:/home/source/main volumes: mysql-volumes: networks: default: name: laravel-app-netword
Repositori:
https://github.com/JkDevArg/Docker-NLM
Atas ialah kandungan terperinci [Docker] Laravel, Nginx MySQL. Untuk maklumat lanjut, sila ikut artikel berkaitan lain di laman web China PHP!