chore: 简化docker-compose部署 (#466)
This commit is contained in:
parent
a2fcd31f24
commit
cbcbdda4c0
|
@ -25,13 +25,13 @@ services:
|
||||||
# Socks代理端口,可选,和 SOCKS_PROXY_HOST 一起时生效
|
# Socks代理端口,可选,和 SOCKS_PROXY_HOST 一起时生效
|
||||||
SOCKS_PROXY_PORT: xxxx
|
SOCKS_PROXY_PORT: xxxx
|
||||||
nginx:
|
nginx:
|
||||||
build: nginx
|
image: nginx:alpine
|
||||||
image: chatgpt/nginx
|
|
||||||
ports:
|
ports:
|
||||||
- '80:80'
|
- '80:80'
|
||||||
expose:
|
expose:
|
||||||
- '80'
|
- '80'
|
||||||
volumes:
|
volumes:
|
||||||
- ./nginx/html/:/etc/nginx/html/
|
- ./nginx/html:/usr/share/nginx/html
|
||||||
|
- ./nginx/nginx.conf:/etc/nginx/conf.d/default.conf
|
||||||
links:
|
links:
|
||||||
- app
|
- app
|
||||||
|
|
|
@ -1,10 +0,0 @@
|
||||||
FROM hub.c.163.com/library/nginx
|
|
||||||
|
|
||||||
MAINTAINER jo "tionsin@live.com"
|
|
||||||
|
|
||||||
RUN rm -rf /etc/nginx/conf.d/default.conf
|
|
||||||
COPY ./nginx.conf /etc/nginx/conf.d/default.conf
|
|
||||||
COPY ./html/ /usr/share/nginx/html/
|
|
||||||
EXPOSE 80
|
|
||||||
|
|
||||||
CMD ["nginx", "-g", "daemon off;"]
|
|
|
@ -3,9 +3,9 @@ server {
|
||||||
server_name localhost;
|
server_name localhost;
|
||||||
charset utf-8;
|
charset utf-8;
|
||||||
error_page 500 502 503 504 /50x.html;
|
error_page 500 502 503 504 /50x.html;
|
||||||
location = / {
|
location / {
|
||||||
root /usr/share/nginx/html;
|
root /usr/share/nginx/html;
|
||||||
index index.html index.htm;
|
try_files $uri /index.html;
|
||||||
}
|
}
|
||||||
|
|
||||||
location /api {
|
location /api {
|
||||||
|
|
|
@ -1,8 +1,7 @@
|
||||||
### docker-compose 部署教程
|
### docker-compose 部署教程
|
||||||
- 将打包好的前端文件放到 `nginx/html` 目录下
|
- 将打包好的前端文件放到 `nginx/html` 目录下
|
||||||
- ```shell
|
- ```shell
|
||||||
# 打包启动
|
# 启动
|
||||||
docker-compose build
|
|
||||||
docker-compose up -d
|
docker-compose up -d
|
||||||
```
|
```
|
||||||
- ```shell
|
- ```shell
|
||||||
|
|
Loading…
Reference in New Issue