Giter VIP home page Giter VIP logo

006.docker-lnmp's Introduction

Docker-LNMP

docker-compose.yml

version: '3'
services:

  ### Nginx container ########Version:1.16.1#################################

  nginx:
      hostname: nginx
      build:
        context: MountData/components/nginx
        dockerfile: Dockerfile
      ports:
        - "${HTTP_PORT1}:80"
      volumes:
        - ${PROJECT_FOLDER}:/nginxapp
        - ./MountData/components/nginx/log:/var/log/nginx
      restart: always
      privileged: true
      networks:
        net-lnmp:
          ipv4_address: 10.127.1.2

  ### PHP container ###########Version:7.4.1##############################

  php:
      hostname: php
      build:
        context: MountData/components/php
        dockerfile: Dockerfile
        args:
          TIME_ZONE: ${GLOBAL_TIME_ZONE}
          CHANGE_SOURCE: ${GLOBAL_CHANGE_SOURCE}
      volumes:
        - ${PROJECT_FOLDER}:/phpapp
        - ./MountData/components/php/log:/var/log
      restart: always
      privileged: true
      networks:
        net-lnmp:
          ipv4_address: 10.127.1.3


  ### Mysql container #########################################

  mariadb:
      hostname: mariadb
      image: harbor.nercoa.com/winjay/mariadb:10.4.11
      ports:
        - "${MYSQL_PORT}:3306"
      volumes:
        - ./MountData/components/mariadb/data:/var/lib/mysql
        - ./MountData/components/mariadb/config/mysql.cnf:/etc/mysql/conf.d/mysql.cnf
        - ./MountData/components/mariadb/log:/var/log/mariadb
      restart: always
      privileged: true
      environment:
        MYSQL_ROOT_PASSWORD: ${MYSQL_PASSWORD}
      networks:
        net-lnmp:
          ipv4_address: 10.127.1.4

networks:
  net-lnmp:
    ipam:
      config:
        - subnet: 10.127.1.0/24

Docker-File-PHP

FROM centos:WinJay
MAINTAINER www.winjay.cn@WinJayX
RUN yum install epel-release -y && \
    yum clean all && \
    rm -rf /var/cache/yum/*
RUN yum install -y gcc gcc-c++ make gd-devel libxml2-devel libcurl-devel libjpeg-devel libpng-devel openssl-devel sqlite-devel
RUN wget http://docs.php.net/distributions/php-7.3.7.tar.gz && \
    tar zxf php-7.3.7.tar.gz && \
    cd php-7.3.7 && \
    ./configure --prefix=/usr/local/php \
    --with-config-file-path=/usr/local/php/etc \
    --enable-fpm --enable-opcache \
    --with-mysql --with-mysqli --with-pdo-mysql \
    --with-openssl --with-zlib --with-curl --with-gd \
    --with-jpeg-dir --with-png-dir --with-freetype-dir \
    --enable-mbstring --with-mcrypt --enable-hash && \
    make -j 4 && make install && \
    cp php.ini-production /usr/local/php/etc/php.ini && \
    cp sapi/fpm/php-fpm.conf /usr/local/php/etc/php-fpm.conf && \
    sed -i "90a \daemonize = no" /usr/local/php/etc/php-fpm.conf && \
    mkdir /usr/local/php/log && \
    cd / && rm -rf php* && \
    ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime

ENV PATH $PATH:/usr/local/php/sbin:/usr/local/php/bin
COPY php.ini /usr/local/php/etc/
COPY php-fpm.conf /usr/local/php/etc/
WORKDIR /usr/local/php
EXPOSE 9000
CMD ["php-fpm"]

Redis-Yaml

  ### Redis container #########################################

  redis:
      image: redis:5.0.5
      ports:
        - "${REDIS_PORT}:6379"
      volumes:
        - ./MountData/components/redis/config/redis.conf:/usr/local/etc/redis/redis.conf
        - ./MountData/components/redis/log/redis.log:/var/log/redis/redis.log
      restart: always
      privileged: true
      networks:
        net-lnmp:
          ipv4_address: 10.127.1.5

  ### Tools container #########################################

  tools:
      build:
        context: build/tools
        args:
          TIME_ZONE: ${GLOBAL_TIME_ZONE}
          CHANGE_SOURCE: ${GLOBAL_CHANGE_SOURCE}
      volumes:
        - ./MountData/components/tools/start.sh:/home/start.sh:rw
        - ./MountData/components/tools/backup:/backup:rw
        - ./MountData/components/tools/cron.d:/etc/cron.d:rw
      restart: always
      privileged: true
      networks:
        net-lnmp:
          ipv4_address: 10.127.1.6

006.docker-lnmp's People

Contributors

winjayx avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.