kphcdr 1 year ago
parent
commit
174d617a75
3 changed files with 12 additions and 23 deletions
  1. 1 1
      README.md
  2. 9 11
      docker-compose.yml
  3. 2 11
      service/php/Dockerfile

+ 1 - 1
README.md

@@ -2,7 +2,7 @@
 
 nginx:1.23.0
 
-php:8.0
+php:8.2
 
 mysql:5.7
 

+ 9 - 11
docker-compose.yml

@@ -1,7 +1,7 @@
 version: '3'
 
 networks:
-  kphcdr:
+  default:
     driver: bridge
 
 services:
@@ -16,17 +16,15 @@ services:
       - ./config/nginx/conf.d:/etc/nginx/conf.d
       - ./logs/nginx/logs:/logs
     networks:
-      - kphcdr
+      - default
     ports:
       - "${NUMBER}080:80"
 
   php:
-    #没有自定义要求就用镜像
-    #build:
-    #  context: ./config/php
-    #  args:
-    #    TZ: "Asia/Shanghai"
-    image: docker.io/kphcdr/kphcdr_php:latest
+    build:
+     context: ./service/php
+     args:
+       TZ: "Asia/Shanghai"
     restart: always
     container_name: ${ABBREVIATION}-php-fpm
     working_dir: /www/server
@@ -34,7 +32,7 @@ services:
       - ./www:/www
       - ./config/php/php.ini:/usr/local/etc/php/php.ini
     networks:
-      - kphcdr
+      - default
 
   mysql:
     container_name: ${ABBREVIATION}-mysql
@@ -50,7 +48,7 @@ services:
       MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
       TZ: "Asia/Shanghai"
     networks:
-      - kphcdr
+      - default
 
   redis:
     container_name: ${ABBREVIATION}-redis
@@ -59,6 +57,6 @@ services:
     volumes:
       - ./data/redis:/data
     networks:
-      - kphcdr
+      - default
     ports:
       - "${NUMBER}6379:6379"

+ 2 - 11
config/php/Dockerfile → service/php/Dockerfile

@@ -15,12 +15,10 @@ RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
 #    echo "deb-src http://mirrors.aliyun.com/debian/ buster-updates main non-free contrib" >>/etc/apt/sources.list && \
 #    echo "deb http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib" >>/etc/apt/sources.list && \
 #    echo "deb-src http://mirrors.aliyun.com/debian/ buster-backports main non-free contrib" >>/etc/apt/sources.list
-
 # Utils
 RUN apt-get update && \
-    apt-get install -y libssl-dev libaio-dev procps wget vim zip unzip git net-tools dnsutils && \
+    apt-get install -y libssl-dev libaio-dev net-tools dnsutils && \
     apt-get clean
-
 # Composer
 RUN curl -sS https://getcomposer.org/installer | php && \
     mv composer.phar /usr/local/bin/composer && \
@@ -46,19 +44,12 @@ RUN echo "Installing Core Libs..." && \
 
     # Redis
     pecl install redis && \
-    docker-php-ext-enable redis && \
-
-     # swoole
-    pecl install swoole && \
-    docker-php-ext-enable swoole
+    docker-php-ext-enable redis
 
 # ZIP
 RUN apt-get install -y libzip-dev && \
     docker-php-ext-install -j$(nproc) zip
 
-## Crontab
-RUN apt-get install -y cron
-
 # Expose port 9000
 EXPOSE 9000