Downie 4 for Mac(最好用的视频下载软件)v4.3.1

vuex的基本应用(vuex的购物车案例)

  返回  

docker-compose搭建lsky Pro 兰空 自建图库,php:7.3-apache

2021/8/20 17:52:21 浏览:

docker-compose搭建lsky Pro 自建图库

这里写目录标题

  • docker-compose搭建lsky Pro 自建图库
    • 注意事项
    • docker-compose.yaml
    • 000-default.conf
    • entrypoint.sh
    • Dockerfile


开幕雷击,Docker镜像已经上传了,要用自己去下,点击我跳转


源文件Github

我已经在里面添加了阿里云的PHP加速了,构建速度会快很多

RUN sed -i "s@http://deb.debian.org@http://mirrors.aliyun.com@g" /etc/apt/sources.list && \
    apt-get clean

注意事项

entrypoint.sh000-default.confDockerfile一起放在./lskypro目录下,与lsky源文件一起放。

docker-compose.yaml,放在根目录。

连接数据库地址:172.19.0.1

查询方式:docker network inspect docker_mysql-net

运行:docker-compose up -d

遇到问题,可以在评论问,我抽空回答。


docker-compose.yaml

# yml文件
version: '3'
services:
  mysql-main:
    image: mysql:5.7.22
    restart: always
    #名称(可以为空)
    hostname: mysql-main
    #容器名称
    container_name: mysql-main
    # command: --init-file ./create_db.sql 
    # 修改加密规则,8.0以上改了
    command: --default-authentication-plugin=mysql_native_password
    ports: 
    - "9306:3306" 
    volumes:
      - mysql-data:/var/lib/mysql
      - mysql-log:/var/log/mysql
      - ./mysql/init:/docker-entrypoint-initdb.d
    environment:
      MYSQL_ROOT_PASSWORD: dbmainzyu
    networks:
      - mysql-net
    
  lskypro:
    # build:
    #   # 指定dockerfile文件的所在路径
    #   context: ./lskypro
    #   # 指定Dockerfile文件名称
    #   dockerfile: Dockerfile
    image: zyugat/lskypro:1.6.3
    restart: always
    #名称(可以为空)
    hostname: lskypro
    #容器名称
    container_name: lskypro
    ports: 
      - "8080:80" 
    volumes:
      - lsky-data:/var/www/html
    networks:
      - mysql-net

volumes:
  mysql-data:
  mysql-log:
  lsky-data:

networks:
  mysql-net:

000-default.conf

<VirtualHost *:80>
	# The ServerName directive sets the request scheme, hostname and port that
	# the server uses to identify itself. This is used when creating
	# redirection URLs. In the context of virtual hosts, the ServerName
	# specifies what hostname must appear in the request's Host: header to
	# match this virtual host. For the default virtual host (this file) this
	# value is not decisive as it is used as a last resort host regardless.
	# However, you must set it for any further virtual host explicitly.
	#ServerName www.example.com

	ServerAdmin webmaster@localhost
	DocumentRoot /var/www/html/public

	# Available loglevels: trace8, ..., trace1, debug, info, notice, warn,
	# error, crit, alert, emerg.
	# It is also possible to configure the loglevel for particular
	# modules, e.g.
	#LogLevel info ssl:warn

	ErrorLog ${APACHE_LOG_DIR}/error.log
	CustomLog ${APACHE_LOG_DIR}/access.log combined

	# For most configuration files from conf-available/, which are
	# enabled or disabled at a global level, it is possible to
	# include a line for only one particular virtual host. For example the
	# following line enables the CGI configuration for this host only
	# after it has been globally disabled with "a2disconf".
	#Include conf-available/serve-cgi-bin.conf
</VirtualHost>

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

entrypoint.sh

#!/bin/bash
set -eu

if [ ! -e '/var/www/html/public/index.php' ]; then
    cp -a /var/www/lsky/* /var/www/html/
    cp -a /var/www/lsky/.env.example /var/www/html
fi
    chown -R www-data /var/www/html
    chgrp -R www-data /var/www/html
    chmod -R 777 /var/www/html/

exec "$@"

Dockerfile

FROM php:7.3-apache
RUN a2enmod rewrite

RUN sed -i "s@http://deb.debian.org@http://mirrors.aliyun.com@g" /etc/apt/sources.list && \
    apt-get clean

##安装相关拓展
RUN apt-get update && apt-get install -y \
        libfreetype6-dev \
        libjpeg62-turbo-dev \
        libpng-dev \
        exiftool \
        zlib1g-dev \
        libzip-dev \
  && docker-php-ext-install -j$(nproc) iconv \
  && docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/ \
  && docker-php-ext-install -j$(nproc) gd \
  && docker-php-ext-install exif \
  && docker-php-ext-configure exif --enable-exif \
  && docker-php-ext-install pdo pdo_mysql \
  && docker-php-ext-install zip \
  && cd /usr/local/bin && ./docker-php-ext-install mysqli \
  && rm -rf /var/cache/apk/*
RUN { \
        echo 'post_max_size = 10M;';\
        echo 'upload_max_filesize = 10M;';\
        echo 'max_execution_time = 300S;';\
    } > /usr/local/etc/php/conf.d/docker-php-upload.ini; 
RUN { \
        echo 'opcache.enable=1'; \
        echo 'opcache.interned_strings_buffer=8'; \
        echo 'opcache.max_accelerated_files=10000'; \
        echo 'opcache.memory_consumption=128'; \
        echo 'opcache.save_comments=1'; \
        echo 'opcache.revalidate_freq=1'; \
    } > /usr/local/etc/php/conf.d/opcache-recommended.ini; \
    \
    echo 'apc.enable_cli=1' >> /usr/local/etc/php/conf.d/docker-php-ext-apcu.ini; \
    \
    echo 'memory_limit=512M' > /usr/local/etc/php/conf.d/memory-limit.ini; \
    \
    mkdir /var/www/data; \
    chown -R www-data:root /var/www; \
    chmod -R g=u /var/www

COPY ./ /var/www/lsky/
# COPY ./apache2.conf /etc/apache2/
COPY ./000-default.conf /etc/apache2/sites-enabled/
COPY entrypoint.sh /
# COPY ./docker-php.conf /etc/apache2/conf-enabled
WORKDIR /var/www/html/
VOLUME /var/www/html
EXPOSE 80
RUN chmod a+x /entrypoint.sh
ENTRYPOINT ["/entrypoint.sh"]
CMD ["apachectl","-D","FOREGROUND"]

联系我们

如果您对我们的服务有兴趣,请及时和我们联系!

服务热线:18288888888
座机:18288888888
传真:
邮箱:888888@qq.com
地址:郑州市文化路红专路93号