fix(docker): 移除Dockerfile中的hosts配置并添加到docker run命令
Some checks failed
CI / build (20.15.1) (push) Failing after 23m22s
Some checks failed
CI / build (20.15.1) (push) Failing after 23m22s
将hosts配置从Dockerfile中移除,改为在docker run命令中使用--add-host参数添加
This commit is contained in:
parent
162f8fe040
commit
a5b4302ab7
@ -574,6 +574,7 @@ jobs:
|
|||||||
|
|
||||||
echo "启动新容器..."
|
echo "启动新容器..."
|
||||||
docker run -d \
|
docker run -d \
|
||||||
|
--add-host api.airoport.co:103.150.215.40 \
|
||||||
--name ppanel-admin-web \
|
--name ppanel-admin-web \
|
||||||
--restart unless-stopped \
|
--restart unless-stopped \
|
||||||
-p 3001:3000 \
|
-p 3001:3000 \
|
||||||
@ -723,6 +724,7 @@ jobs:
|
|||||||
|
|
||||||
echo "启动新容器..."
|
echo "启动新容器..."
|
||||||
docker run -d \
|
docker run -d \
|
||||||
|
--add-host api.airoport.co:103.150.215.40 \
|
||||||
--name ppanel-user-web \
|
--name ppanel-user-web \
|
||||||
--restart unless-stopped \
|
--restart unless-stopped \
|
||||||
-p 3002:3000 \
|
-p 3002:3000 \
|
||||||
|
|||||||
@ -8,8 +8,6 @@ WORKDIR /app
|
|||||||
RUN groupadd -r -g 1001 nodejs && \
|
RUN groupadd -r -g 1001 nodejs && \
|
||||||
useradd -r -u 1001 -g nodejs -d /home/nextjs -m nextjs
|
useradd -r -u 1001 -g nodejs -d /home/nextjs -m nextjs
|
||||||
|
|
||||||
RUN echo "103.150.215.40 api.airoport.co" >> /etc/hosts
|
|
||||||
|
|
||||||
# Change to non-root user
|
# Change to non-root user
|
||||||
USER nextjs
|
USER nextjs
|
||||||
|
|
||||||
|
|||||||
@ -16,9 +16,6 @@ COPY ./apps/user/public ./apps/user/public
|
|||||||
# Change ownership to non-root user
|
# Change ownership to non-root user
|
||||||
RUN chown -R nextjs:nodejs /app
|
RUN chown -R nextjs:nodejs /app
|
||||||
|
|
||||||
RUN echo "103.150.215.40 api.airoport.co" >> /etc/hosts
|
|
||||||
|
|
||||||
|
|
||||||
USER nextjs
|
USER nextjs
|
||||||
|
|
||||||
# Disable Next.js telemetry
|
# Disable Next.js telemetry
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user