mirror of
https://github.com/cedar2025/Xboard.git
synced 2025-01-22 10:38:14 -05:00
use docker env on .env file
This commit is contained in:
parent
1d9cb2295c
commit
c4595bc665
69
.env.example
Executable file → Normal file
69
.env.example
Executable file → Normal file
@ -1,43 +1,40 @@
|
|||||||
APP_NAME=XBoard
|
APP_NAME=${APP_NAME:-XBoard}
|
||||||
APP_ENV=local
|
APP_ENV=${APP_ENV:-local}
|
||||||
APP_KEY=base64:PZXk5vTuTinfeEVG5FpYv2l6WEhLsyvGpiWK7IgJJ60=
|
APP_KEY=${APP_KEY:-base64:PZXk5vTuTinfeEVG5FpYv2l6WEhLsyvGpiWK7IgJJ60=}
|
||||||
APP_DEBUG=false
|
APP_DEBUG=${APP_DEBUG:-false}
|
||||||
APP_URL=http://localhost
|
APP_URL=${APP_URL:-http://localhost}
|
||||||
|
ADMIN_SETTING_CACHE=${ADMIN_SETTING_CACHE:-60}
|
||||||
|
LOG_CHANNEL=${LOG_CHANNEL:-stack}
|
||||||
|
|
||||||
ADMIN_SETTING_CACHE=60 #设置缓存时间(单位秒)
|
DB_CONNECTION=${DB_CONNECTION:-mysql}
|
||||||
LOG_CHANNEL=stack
|
DB_HOST=${DB_HOST:-127.0.0.1}
|
||||||
|
DB_PORT=${DB_PORT:-3306}
|
||||||
|
DB_DATABASE=${DB_DATABASE:-xboard}
|
||||||
|
DB_USERNAME=${DB_USERNAME:-root}
|
||||||
|
DB_PASSWORD=${DB_PASSWORD:-}
|
||||||
|
|
||||||
DB_CONNECTION=mysql
|
REDIS_HOST=${REDIS_HOST:-127.0.0.1}
|
||||||
DB_HOST=127.0.0.1
|
REDIS_PASSWORD=${REDIS_PASSWORD:-null}
|
||||||
DB_PORT=3306
|
REDIS_PORT=${REDIS_PORT:-6379}
|
||||||
DB_DATABASE=xboard
|
|
||||||
DB_USERNAME=root
|
|
||||||
DB_PASSWORD=
|
|
||||||
|
|
||||||
REDIS_HOST=127.0.0.1
|
BROADCAST_DRIVER=${BROADCAST_DRIVER:-log}
|
||||||
REDIS_PASSWORD=null
|
CACHE_DRIVER=${CACHE_DRIVER:-redis}
|
||||||
REDIS_PORT=6379
|
QUEUE_CONNECTION=${QUEUE_CONNECTION:-redis}
|
||||||
|
|
||||||
#默认将队列驱动和缓存驱动都修改为了redis,请务必安装redis
|
MAIL_DRIVER=${MAIL_DRIVER:-smtp}
|
||||||
BROADCAST_DRIVER=log
|
MAIL_HOST=${MAIL_HOST:-smtp.mailtrap.io}
|
||||||
CACHE_DRIVER=redis
|
MAIL_PORT=${MAIL_PORT:-2525}
|
||||||
QUEUE_CONNECTION=redis
|
MAIL_USERNAME=${MAIL_USERNAME:-null}
|
||||||
|
MAIL_PASSWORD=${MAIL_PASSWORD:-null}
|
||||||
|
MAIL_ENCRYPTION=${MAIL_ENCRYPTION:-null}
|
||||||
|
MAIL_FROM_ADDRESS=${MAIL_FROM_ADDRESS:-null}
|
||||||
|
MAIL_FROM_NAME=${MAIL_FROM_NAME:-null}
|
||||||
|
|
||||||
MAIL_DRIVER=smtp
|
MAILGUN_DOMAIN=${MAILGUN_DOMAIN:-}
|
||||||
MAIL_HOST=smtp.mailtrap.io
|
MAILGUN_SECRET=${MAILGUN_SECRET:-}
|
||||||
MAIL_PORT=2525
|
|
||||||
MAIL_USERNAME=null
|
|
||||||
MAIL_PASSWORD=null
|
|
||||||
MAIL_ENCRYPTION=null
|
|
||||||
MAIL_FROM_ADDRESS=null
|
|
||||||
MAIL_FROM_NAME=null
|
|
||||||
MAILGUN_DOMAIN=
|
|
||||||
MAILGUN_SECRET=
|
|
||||||
|
|
||||||
# google cloud stoage
|
ENABLE_AUTO_BACKUP_AND_UPDATE=${ENABLE_AUTO_BACKUP_AND_UPDATE:-false}
|
||||||
ENABLE_AUTO_BACKUP_AND_UPDATE=false
|
GOOGLE_CLOUD_KEY_FILE=${GOOGLE_CLOUD_KEY_FILE:-config/googleCloudStorageKey.json}
|
||||||
GOOGLE_CLOUD_KEY_FILE=config/googleCloudStorageKey.json
|
GOOGLE_CLOUD_STORAGE_BUCKET=${GOOGLE_CLOUD_STORAGE_BUCKET:-}
|
||||||
GOOGLE_CLOUD_STORAGE_BUCKET=
|
|
||||||
|
|
||||||
# 用于阻止重复安装
|
INSTALLED=${INSTALLED:-false}
|
||||||
INSTALLED=false
|
|
||||||
|
27
Dockerfile
27
Dockerfile
@ -2,16 +2,25 @@ FROM phpswoole/swoole:php8.1-alpine
|
|||||||
|
|
||||||
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
|
COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
|
||||||
|
|
||||||
RUN install-php-extensions pcntl bcmath inotify \
|
# 安装基础软件包,包括 gettext (提供 envsubst)
|
||||||
&& apk --no-cache add shadow supervisor nginx sqlite nginx-mod-http-brotli mysql-client git patch \
|
RUN install-php-extensions pcntl bcmath inotify \
|
||||||
&& addgroup -S -g 1000 www && adduser -S -G www -u 1000 www
|
&& apk --no-cache add shadow supervisor nginx sqlite nginx-mod-http-brotli mysql-client git patch gettext \
|
||||||
#复制项目文件以及配置文件
|
&& addgroup -S -g 1000 www && adduser -S -G www -u 1000 www
|
||||||
|
|
||||||
|
# 设置工作目录
|
||||||
WORKDIR /www
|
WORKDIR /www
|
||||||
|
|
||||||
|
# 复制项目文件和配置文件
|
||||||
COPY .docker /
|
COPY .docker /
|
||||||
COPY . /www
|
COPY . /www
|
||||||
RUN composer install --optimize-autoloader --no-cache --no-dev \
|
COPY .env.example /www/.env.example
|
||||||
&& php artisan storage:link \
|
|
||||||
&& chown -R www:www /www \
|
|
||||||
&& chmod -R 775 /www
|
|
||||||
|
|
||||||
CMD /usr/bin/supervisord --nodaemon -c /etc/supervisor/supervisord.conf
|
# 生成环境变量文件并安装依赖
|
||||||
|
RUN envsubst < /www/.env.template > /www/.env \
|
||||||
|
&& composer install --optimize-autoloader --no-cache --no-dev \
|
||||||
|
&& php artisan storage:link \
|
||||||
|
&& chown -R www:www /www \
|
||||||
|
&& chmod -R 775 /www
|
||||||
|
|
||||||
|
# 启动 supervisor
|
||||||
|
CMD /usr/bin/supervisord --nodaemon -c /etc/supervisor/supervisord.conf
|
||||||
|
Loading…
Reference in New Issue
Block a user