Skip to content

Commit bf5271f

Browse files
committed
脱离对sail的依赖,直接通过docker-compose启动容器
1 parent 9703265 commit bf5271f

File tree

11 files changed

+7
-2
lines changed

11 files changed

+7
-2
lines changed

context/Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ENV TZ=UTC
1111

1212
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
1313

14+
# 替换Ubuntu软件源
1415
RUN sed -i 's/archive.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
1516
RUN sed -i 's/security.ubuntu.com/mirrors.aliyun.com/g' /etc/apt/sources.list
1617

@@ -33,6 +34,10 @@ RUN apt-get update \
3334
&& apt-get clean \
3435
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
3536

37+
# 设置镜像&安装PHP依赖
38+
RUN composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/
39+
RUN composer install
40+
3641
RUN setcap "cap_net_bind_service=+ep" /usr/bin/php8.2
3742

3843
RUN groupadd --force -g $WWWGROUP sail

docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ services:
55
context: ./context
66
dockerfile: Dockerfile
77
args:
8-
WWWGROUP: '${WWWGROUP}'
8+
WWWGROUP: 'sail'
99
image: sail-8.2/app
1010
extra_hosts:
1111
- 'host.docker.internal:host-gateway'
1212
ports:
1313
- '${APP_PORT:-80}:80'
1414
- '${VITE_PORT:-5173}:${VITE_PORT:-5173}'
1515
environment:
16-
WWWUSER: '${WWWUSER}'
16+
WWWUSER: 'sail'
1717
LARAVEL_SAIL: 1
1818
XDEBUG_MODE: '${SAIL_XDEBUG_MODE:-off}'
1919
XDEBUG_CONFIG: '${SAIL_XDEBUG_CONFIG:-client_host=host.docker.internal}'

storage/app/.gitignore

100644100755
File mode changed.

storage/app/public/.gitignore

100644100755
File mode changed.

storage/framework/.gitignore

100644100755
File mode changed.

storage/framework/cache/.gitignore

100644100755
File mode changed.

storage/framework/cache/data/.gitignore

100644100755
File mode changed.

storage/framework/sessions/.gitignore

100644100755
File mode changed.

storage/framework/testing/.gitignore

100644100755
File mode changed.

storage/framework/views/.gitignore

100644100755
File mode changed.

0 commit comments

Comments
 (0)