fix uploads dir

This commit is contained in:
aichy126 2022-11-09 15:00:17 +08:00
parent a254f432ff
commit 407e29f63d
6 changed files with 8 additions and 8 deletions

2
.gitignore vendored
View File

@ -9,7 +9,7 @@
/.fleet
/.vscode/*.log
/cmd/answer/*.sh
/cmd/answer/upfiles/*
/cmd/answer/uploads/*
/cmd/logs
/configs/config-dev.yaml
/go.work*

View File

@ -29,7 +29,7 @@ RUN apk --no-cache add build-base git \
&& make clean build \
&& cp answer /usr/bin/answer
RUN mkdir -p /data/upfiles && chmod 777 /data/upfiles \
RUN mkdir -p /data/uploads && chmod 777 /data/uploads \
&& mkdir -p /data/i18n && cp -r i18n/*.yaml /data/i18n
# stage3 copy the binary and resource files into fresh container

View File

@ -91,7 +91,7 @@ swaggerui:
service_config:
secret_key: "answer" #encryption key
web_host: "http://127.0.0.1" #Page access using domain name address
upload_path: "./upfiles" #upload directory
upload_path: "./uploads" #upload directory
```
## Compile the image
@ -100,4 +100,4 @@ If you have modified the source files and want to repackage the image, you can u
docker build -t answer:v1.0.0 .
```
## common problem
1. The project cannot be started: the main program startup depends on proper configuraiton of the configuration file, `config.yaml`, as well as the internationalization translation directory (`i18n`), and the upload file storage directory (`upfiles`). Ensure that the configuration file is loaded when the project starts, such as when using `answer run -c config.yaml` and that the `config.yaml` correctly specifies the i18n and upfiles directories.
1. The project cannot be started: the main program startup depends on proper configuraiton of the configuration file, `config.yaml`, as well as the internationalization translation directory (`i18n`), and the upload file storage directory (`uploads`). Ensure that the configuration file is loaded when the project starts, such as when using `answer run -c config.yaml` and that the `config.yaml` correctly specifies the i18n and uploads directories.

View File

@ -94,7 +94,7 @@ swaggerui:
service_config:
secret_key: "answer" #加密key
web_host: "http://127.0.0.1" #页面访问使用域名地址
upload_path: "./upfiles" #上传目录
upload_path: "./uploads" #上传目录
```
## 编译镜像
@ -103,4 +103,4 @@ service_config:
docker build -t answer:v1.0.0 .
```
## 常见问题
1. 项目无法启动answer 主程序启动依赖配置文件 config.yaml 、国际化翻译目录 /i18n 、上传文件存放目录 /upfiles需要确保项目启动时加载了配置文件 answer run -c config.yaml 以及在 config.yaml 正确的指定 i18n 和 upfiles 目录的配置项
1. 项目无法启动answer 主程序启动依赖配置文件 config.yaml 、国际化翻译目录 /i18n 、上传文件存放目录 /uploads answer run -c config.yaml 以及在 config.yaml 正确的指定 i18n 和 uploads 目录的配置项

View File

@ -17,4 +17,4 @@ swaggerui:
service_config:
secret_key: "answer"
web_host: "http://127.0.0.1:9080"
upload_path: "/data/upfiles"
upload_path: "/data/uploads"

View File

@ -17,7 +17,7 @@ const (
var (
ConfigFilePath = "/conf/"
UploadFilePath = "/upfiles/"
UploadFilePath = "/uploads/"
I18nPath = "/i18n/"
)