mirror of
https://github.com/yeasy/docker_practice.git
synced 2026-08-10 08:27:25 +00:00
Restore nginx 1.30 stable references
This commit is contained in:
@@ -34,7 +34,7 @@ Starting ──成功──> Healthy ──失败N次──> Unhealthy
|
||||
#### Web 服务检查
|
||||
|
||||
```docker
|
||||
# 注:nginx 镜像推荐使用具体的版本标签(如 nginx:1.28-alpine)
|
||||
# 注:nginx 镜像推荐使用具体的版本标签(如 nginx:1.30-alpine)
|
||||
FROM nginx
|
||||
RUN apt-get update && apt-get install -y curl && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
|
||||
@@ -176,5 +176,5 @@ $ docker build --target builder -t username/imagename:tag .
|
||||
上面例子中我们使用 `COPY --from=0 /go/src/github.com/go/helloworld/app .` 从上一阶段的镜像中复制文件,我们也可以复制任意镜像中的文件。
|
||||
|
||||
```docker
|
||||
COPY --from=nginx:1.28-alpine /etc/nginx/nginx.conf /nginx.conf
|
||||
COPY --from=nginx:1.30-alpine /etc/nginx/nginx.conf /nginx.conf
|
||||
```
|
||||
|
||||
@@ -128,8 +128,8 @@ RUN set -x ; cd ${LARAVEL_PATH} \
|
||||
### 7.18.5 最后一个阶段构建 NGINX 镜像
|
||||
|
||||
```docker
|
||||
# 注:nginx 镜像推荐使用具体的版本标签(如 nginx:1.28-alpine)
|
||||
FROM nginx:1.28-alpine as nginx
|
||||
# 注:nginx 镜像推荐使用具体的版本标签(如 nginx:1.30-alpine)
|
||||
FROM nginx:1.30-alpine as nginx
|
||||
|
||||
ARG LARAVEL_PATH=/app/laravel
|
||||
|
||||
@@ -179,7 +179,7 @@ $ docker run -dit --rm --network=laravel -p 8080:80 my/nginx
|
||||
完整的 `Dockerfile` 文件如下。
|
||||
|
||||
```docker
|
||||
# 注:生产环境推荐使用具体的版本标签,如 node:20-alpine、composer:2.x、php:8.3-fpm-alpine、nginx:1.28-alpine
|
||||
# 注:生产环境推荐使用具体的版本标签,如 node:20-alpine、composer:2.x、php:8.3-fpm-alpine、nginx:1.30-alpine
|
||||
FROM node:20-alpine as frontend
|
||||
|
||||
COPY package.json /app/
|
||||
@@ -229,7 +229,7 @@ RUN set -x ; cd ${LARAVEL_PATH} \
|
||||
&& chmod -R 777 storage \
|
||||
&& php artisan package:discover
|
||||
|
||||
FROM nginx:1.28-alpine as nginx
|
||||
FROM nginx:1.30-alpine as nginx
|
||||
|
||||
ARG LARAVEL_PATH=/app/laravel
|
||||
|
||||
|
||||
@@ -47,7 +47,7 @@ RUN set -x ; cd ${LARAVEL_PATH} \
|
||||
&& chmod -R 777 storage \
|
||||
&& php artisan package:discover
|
||||
|
||||
FROM nginx:1.28-alpine as nginx
|
||||
FROM nginx:1.30-alpine as nginx
|
||||
|
||||
ARG LARAVEL_PATH=/app/laravel
|
||||
|
||||
|
||||
Reference in New Issue
Block a user