webman-admin Dockerfile

Dockerfile

FROM php:8.1-alpine
WORKDIR /data
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
    && apk update --no-cache \
    && apk add zlib-dev \
    && apk add libpng-dev \
    && apk add freetype-dev \
    && apk add libjpeg-turbo-dev \
    && docker-php-source extract \
    && docker-php-ext-configure gd --enable-gd --with-freetype --with-jpeg \
    && docker-php-ext-install -j$(nproc) pcntl pdo_mysql gd \
    && docker-php-ext-enable opcache pcntl pdo_mysql gd \
    && mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini" \
    && sed -i 's/post_max_size =.*/post_max_size = 50M/g' "$PHP_INI_DIR/php.ini" \
    && sed -i 's/upload_max_filesize =.*/upload_max_filesize = 50M/g' "$PHP_INI_DIR/php.ini" \
    && sed -i 's/;date.timezone =.*/date.timezone = PRC/g' "$PHP_INI_DIR/php.ini" \
    && sed -i 's/short_open_tag =.*/short_open_tag = On/g' "$PHP_INI_DIR/php.ini" \
    && sed -i 's/;cgi.fix_pathinfo=.*/cgi.fix_pathinfo=0/g' "$PHP_INI_DIR/php.ini" \
    && sed -i 's/max_execution_time =.*/max_execution_time = 300/g' "$PHP_INI_DIR/php.ini" \
    && sed -i 's/disable_functions =.*/disable_functions = passthru,exec,system,chroot,chgrp,chown,shell_exec,proc_open,proc_get_status,popen,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru/g' "$PHP_INI_DIR/php.ini" \
    && php -r "copy('https://install.phpcomposer.com/installer', 'composer-setup.php');" \
    && php composer-setup.php \
    && php -r "unlink('composer-setup.php');" \
    && mv composer.phar /usr/local/bin/composer \
    && composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ \
    && docker-php-source delete \
    && rm -rf /var/cache/apk/*

docker-compose.yml

version: "3"
services:
  webman-admin:
    build: .
    container_name: webman-admin
    image: webman-admin:v1
    restart: unless-stopped
    volumes:
      - "./:/data"
    ports:
      - "8888:8787"
    command: [ "php", "start.php", "start" ]
957 1 1
1个评论

不羁如风

非常棒啊

  • 暂无评论

440
积分
0
获赞数
0
粉丝数
2023-04-24 加入
×
🔝