做服装外贸哪个网站好学做西餐网站
做服装外贸哪个网站好,学做西餐网站,wordpress可以做什么站,餐饮营销型网站案例这个是docker 配置的base dockerfile 如果搭建phpnginx 环境#xff0c;可以直接使用这个dockerfile配置。直接在你代码里面的dockerfile 引用此基础镜像。
# 使用官方的 PHP 镜像作为基础镜像 FROM php:8.1-fpm
# 更换国内源并安装系统依赖
RUN rm -rf /etc/apt/sources.l…这个是docker 配置的base dockerfile 如果搭建phpnginx 环境可以直接使用这个dockerfile配置。直接在你代码里面的dockerfile 引用此基础镜像。
# 使用官方的 PHP 镜像作为基础镜像 FROM php:8.1-fpm
# 更换国内源并安装系统依赖
RUN rm -rf /etc/apt/sources.list.d/* \ echo deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware /etc/apt/sources.list \ echo deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware /etc/apt/sources.list \ echo deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware /etc/apt/sources.list \ echo deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware /etc/apt/sources.list \ echo deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware /etc/apt/sources.list \ echo deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware /etc/apt/sources.list \ echo deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware /etc/apt/sources.list \ echo deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware /etc/apt/sources.list \ apt-get update \ apt-get install -y \ locales \ nginx \ libpng-dev \ libjpeg-dev \ libonig-dev \ libxml2-dev \ zip \ unzip \ libzip-dev \ libmcrypt-dev \ libssl-dev \ libfreetype6-dev \ libjpeg62-turbo-dev \ freetds-dev \ libcurl4-openssl-dev \ libsnmp-dev \ libicu-dev \ libc-client-dev \ libkrb5-dev \ libmemcached-dev \ libbz2-dev \ libtidy-dev \ libxslt-dev \ wget \ curl \ cron \ supervisor \ sed -i /zh_CN.UTF-8/s/# //g /etc/locale.gen \ locale-gen zh_CN.UTF-8 \ apt-get clean \ rm -rf /var/lib/apt/lists/*
# 设置环境变量以使用中文区域设置 ENV LANGzh_CN.UTF-8 ENV LANGUAGEzh_CN:zh ENV LC_ALLzh_CN.UTF-8
# 安装 PHP 扩展 RUN docker-php-ext-install \ bcmath \ bz2 \ calendar \ exif \ gd \ gettext \ mysqli \ opcache \ pdo \ pdo_mysql \ snmp \ soap \ sockets \ tidy \ xml \ xsl \ zip
# 下载并安装 Composer RUN php -r copy(https://getcomposer.org/installer, composer-setup.php); \ php composer-setup.php --install-dir/usr/local/bin --filenamecomposer \ php -r unlink(composer-setup.php); \ mkdir /composer \ chown www-data:www-data /composer \ chmod 755 /composer
# 设置 Composer 全局路径 ENV COMPOSER_HOME/composer ENV PATH/composer/vendor/bin:$PATH
# 安装 Redis 和 Yaf 扩展 RUN pecl install redis \ docker-php-ext-enable redis \ pecl install yaf \ docker-php-ext-enable yaf
# 设置权限和目录 RUN chown www-data:www-data /var/www/html \ chmod 755 /var/www/html \ mkdir /etc/nginx/conf.d/ssl \ chmod 755 /etc/nginx/conf.d/ssl
# 复制supervisord配置文件 COPY supervisord.conf /etc/supervisor/supervisord.conf
# 暴露容器的 80 和 443 端口 EXPOSE 80 443
# 启动 PHP-FPM 和 Nginx 服务 #CMD /etc/init.d/nginx start /usr/local/sbin/php-fpm -D tail -f /dev/null
下面是supervisord 配置。用suervisord 控制PHP-fpm 和nginx 的启动
; supervisor config file
[unix_http_server] file/var/run/supervisor.sock ; (the path to the socket file) chmod0700 ; sockef file mode (default 0700)
[supervisord] logfile/var/log/supervisor/supervisord.log ; (main log file;default $CWD/supervisord.log) pidfile/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) childlogdir/var/log/supervisor ; (AUTO child log dir, default $TEMP)
; the below section must remain in the config file for RPC ; (supervisorctl/web interface) to work, additional interfaces may be ; added by defining them in separate rpcinterface: sections [rpcinterface:supervisor] supervisor.rpcinterface_factory supervisor.rpcinterface:make_main_rpcinterface
[supervisorctl] serverurlunix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket
; The [include] section can just contain the files setting. This ; setting can list multiple files (separated by whitespace or ; newlines). It can also contain wildcards. The filenames are ; interpreted as relative to this file. Included files *cannot* ; include files themselves.
[program:php-fpm] command /usr/local/sbin/php-fpm --force-stderr --nodaemonize --fpm-config /usr/local/etc/php-fpm.conf autostarttrue autorestarttrue priority5 stdout_events_enabledtrue stderr_events_enabledtrue stdout_logfile/dev/stdout stdout_logfile_maxbytes0 stderr_logfile/dev/stderr stderr_logfile_maxbytes0 stopsignalQUIT
[program:nginx] command/usr/sbin/nginx -g daemon off; -c /etc/nginx/nginx.conf autostarttrue autorestarttrue priority10 stdout_events_enabledtrue stderr_events_enabledtrue stdout_logfile/dev/stdout stdout_logfile_maxbytes0 stderr_logfile/dev/stderr stderr_logfile_maxbytes0 stopsignalQUIT
直接把这两份配置上传到你的服务器里面。然后执行下面的命令
docker build -t php-nginx -f /home/data/dockerfile/prod/Dockerfile .
php-nginx 是镜像的名字
/home/data/dockerfile/prod/Dockerfile 是dockerfile 文件路径
最后的点一定要加上。
base 镜像编辑好后可以上传到阿里云的免费的镜像容器服务。然后在docker部署的时候引用此基础镜像就可以了
本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/bicheng/88830.shtml
如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!