Skip to content

Commit

Permalink
update orm config
Browse files Browse the repository at this point in the history
  • Loading branch information
slTrust committed Feb 19, 2021
1 parent e38f972 commit bbc97ab
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Expand Up @@ -4,8 +4,8 @@ WORKDIR /usr/src/app
COPY package.json ./
# 因为我们用的是 yarn 不是 npm
COPY yarn.lock ./
# run 开头 代表运行 命令
RUN yarn cache clean & yarn install --verbose --network-timeout 60000
# run 开头 代表运行 命令 设置超时时间
RUN yarn cache clean & yarn install --network-timeout 60000
# 这个意思是 把你项目根目录的内容 拷贝到 工作目录
COPY . .
# 暴露端口
Expand Down
2 changes: 2 additions & 0 deletions lib/getDatabaseConnection.tsx
Expand Up @@ -9,6 +9,8 @@ const create = async () => {
// @ts-ignore
return createConnection({
...config,
host: process.env.NODE_ENV === 'production' ? 'localhost' : config.host,
database: process.env.NODE_ENV === 'production' ? 'blog_production' : 'blog_development',
entities: [Post, User, Comment]
});
};
Expand Down

0 comments on commit bbc97ab

Please sign in to comment.