refactor(docker): update port configuration and remove docker-compose
This commit is contained in:
@@ -21,7 +21,7 @@ FROM nginx:alpine AS production
|
|||||||
# 复制自定义 nginx 配置
|
# 复制自定义 nginx 配置
|
||||||
COPY <<EOF /etc/nginx/conf.d/default.conf
|
COPY <<EOF /etc/nginx/conf.d/default.conf
|
||||||
server {
|
server {
|
||||||
listen 80;
|
listen 5173;
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html;
|
index index.html;
|
||||||
@@ -54,7 +54,7 @@ EOF
|
|||||||
COPY --from=builder /app/dist /usr/share/nginx/html
|
COPY --from=builder /app/dist /usr/share/nginx/html
|
||||||
|
|
||||||
# 暴露端口
|
# 暴露端口
|
||||||
EXPOSE 80
|
EXPOSE 5173
|
||||||
|
|
||||||
# 启动 nginx
|
# 启动 nginx
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
CMD ["nginx", "-g", "daemon off;"]
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
version: '3.8'
|
|
||||||
|
|
||||||
networks:
|
|
||||||
proxy-net:
|
|
||||||
external: true # 使用已存在的 proxy-net 网络
|
|
||||||
|
|
||||||
services:
|
|
||||||
teres_web_frontend:
|
|
||||||
image: ${TE_FE_IMAGE_NAME}
|
|
||||||
container_name: teres_web_frontend
|
|
||||||
networks:
|
|
||||||
- proxy-net # 加入 NPM 的网络
|
|
||||||
ports:
|
|
||||||
- "5173:80" # 将容器内的80端口映射到主机的5173端口
|
|
||||||
restart: unless-stopped
|
|
||||||
Reference in New Issue
Block a user