# alpine-php **Repository Path**: musickr/alpine-php ## Basic Information - **Project Name**: alpine-php - **Description**: docker镜像 - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2023-12-20 - **Last Updated**: 2023-12-22 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README Docker - PHP ---- ---- - 编译步骤 ``` apk --update add gcc make g++ zlib-dev libxml2-dev sqlite-dev openssl openssl-dev curl curl-dev oniguruma oniguruma-dev libpng-dev perl linux-headers ./configure --prefix=/usr/local/php --with-config-file-path=/usr/local/php/etc --with-openssl --with-curl --enable-mbstring --enable-bcmath --enable-fpm --enable-gd --with-zlib --enable-zip --with-mysqli ln -s /usr/local/php/bin/php /usr/bin/php ln -s /usr/local/php/sbin/php-fpm /usr/sbin/php-fpm cp php.ini-development /usr/local/php/lib/php.ini cp /usr/local/php/etc/php-fpm.conf.default /usr/local/php/etc/php-fpm.conf cp /usr/local/php/etc/php-fpm.d/www.conf.default /usr/local/php/etc/php-fpm.d/www.conf docker build -t php-alpine . ``` - 同步到阿里云 ``` # 这一步输入的密码为阿里云容器镜像服务默认实例 -> 访问凭证页面设置的固定或者临时密码,并非阿里云账号密码。 $ sudo docker login --username=a9102384955 registry.cn-hangzhou.aliyuncs.com 545ce8046831 docker tag [本地应用镜像ID] registry.cn-hangzhou.aliyuncs.com/musickr/php-alpine docker tag ab42ca720e01 registry.cn-hangzhou.aliyuncs.com/musickr/php-alpine:0.0.4 docker push registry.cn-hangzhou.aliyuncs.com/musickr/php-alpine:0.0.4 # nginx: # image: nginx:stable-alpine # environment: # - TZ=Asia/Shanghai # container_name: nginx # ports: # - "80:80" # volumes: # - ./conf/nginx/:/etc/nginx/conf.d # - ./www:/usr/share/nginx/html ``` - nginx配置 ``` server { listen 80; listen [::]:80; server_name localhost; #access_log /var/log/nginx/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { root html; fastcgi_pass php:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } ```