全球主机交流论坛

标题: 麻烦推荐个一键docker安装php+mysql环境 [打印本页]

作者: mishi    时间: 2023-2-3 17:18
标题: 麻烦推荐个一键docker安装php+mysql环境
想装个wp博客玩玩,想在op下的docker一键搞个php环境系统
简单易用的  有没有啥推荐的

谢谢大佬
作者: cicvc    时间: 2023-2-3 17:30
你为啥不直接一键docker wordpress?
作者: 920    时间: 2023-2-3 17:59
可以docker 安装宝塔,
作者: vinny    时间: 2023-2-3 18:00
总感觉数据库还是别放docker了
作者: 小白鸡    时间: 2023-2-3 18:01
数据库放Docker得心多大啊...
作者: taixiao    时间: 2023-2-3 22:44
https://github.com/yeszao/dnmp
作者: 0x99    时间: 2023-2-5 10:30
本帖最后由 0x99 于 2023-2-5 12:34 编辑

# Use an official PHP image as the base image
FROM php:8.1-apache

# Set the working directory in the container to /var/www/html
WORKDIR /var/www/html

# Install necessary extensions for PHP
RUN apt-get update && apt-get install -y \
    libicu-dev \
    libpq-dev \
    libpng-dev \
    libjpeg-dev \
    libfreetype6-dev \
    libexif-dev \
    wget \
    libzip-dev \
    zlib1g-dev \
    && docker-php-ext-configure gd --with-jpeg --with-freetype \
    && docker-php-ext-install -j$(nproc) intl gd pdo_pgsql pdo_mysql exif zip \
    && a2enmod rewrite

# Expose port 80 for Apache
EXPOSE 80

# Set the command to run when the container starts
CMD ["apache2-foreground"]




欢迎光临 全球主机交流论坛 (https://loc.516000.xyz/) Powered by Discuz! X3.4