Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2f4fb35
commit 1b1b4ad
Showing
7 changed files
with
84 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
FROM node | ||
|
||
LABEL maintainer = "yhlben <yinhengliben@gmail.com>" | ||
|
||
RUN rm -rf /app | ||
RUN mkdir /app | ||
|
||
WORKDIR /app | ||
|
||
COPY . /app | ||
|
||
RUN npm install | ||
RUN npm run build | ||
RUN mv ./dist/* ./ | ||
|
||
EXPOSE 8082 | ||
|
||
CMD BUILD_ENV=docker node app.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
version: '3.7' | ||
|
||
services: | ||
database: | ||
image: mongo | ||
restart: always | ||
volumes: | ||
- ~/data/db:/data/db | ||
networks: | ||
- webapp-network | ||
|
||
web: | ||
image: yhlben/cdfang-spider | ||
depends_on: | ||
- database | ||
ports: | ||
- 8082:8082 | ||
networks: | ||
- webapp-network | ||
|
||
networks: | ||
webapp-network: | ||
driver: bridge |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,11 @@ | ||
const mongoDBHost = | ||
process.env.BUILD_ENV === 'docker' | ||
? 'mongodb://database/test' | ||
: 'mongodb://localhost/test'; | ||
|
||
export default { | ||
spiderDomain: 'http://zw.cdzj.chengdu.gov.cn', | ||
serverPort: 8082 | ||
serverPort: 8082, | ||
// 和 docker-compose 里的 mongo 容器相对应 | ||
databaseUrl: mongoDBHost | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters