-
Notifications
You must be signed in to change notification settings - Fork 529
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from crawlab-team/develop
Develop
- Loading branch information
Showing
20 changed files
with
463 additions
and
156 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 |
---|---|---|
|
@@ -7,3 +7,4 @@ yarn.lock | |
.DS_Store | ||
package-lock.json | ||
.umi/ | ||
dist/ |
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,3 +1,18 @@ | ||
FROM jelastic/nodejs:8.16.1-npm AS frontend | ||
|
||
WORKDIR /app | ||
ADD . /app | ||
RUN npm install | ||
RUN npm run build | ||
|
||
FROM jelastic/nodejs:8.16.1-npm | ||
|
||
COPY . /app | ||
WORKDIR /app | ||
ADD . /app | ||
COPY --from=frontend /app/dist /frontend | ||
RUN cp ./backend/package.json . | ||
RUN npm install --registry=https://registry.npm.taobao.org | ||
RUN yum install -y nginx | ||
RUN cp /app/nginx/artipub.conf /etc/nginx/conf.d | ||
|
||
CMD /app/docker_init.sh |
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 jelastic/nodejs:8.16.1-npm AS frontend | ||
|
||
WORKDIR /app | ||
ADD . /app | ||
RUN npm install --registry=https://registry.npm.taobao.org | ||
RUN npm run build | ||
|
||
FROM jelastic/nodejs:8.16.1-npm | ||
|
||
WORKDIR /app | ||
ADD . /app | ||
COPY --from=frontend /app/dist /frontend | ||
RUN cp ./backend/package.json . | ||
RUN npm install --registry=https://registry.npm.taobao.org | ||
RUN yum install -y nginx | ||
RUN cp /app/nginx/artipub.conf /etc/nginx/conf.d | ||
|
||
CMD /app/docker_init.sh |
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
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,15 +1,16 @@ | ||
version: '3.3' | ||
services: | ||
master: | ||
app: | ||
image: "tikazyq/artipub:latest" | ||
environment: | ||
CRAWLAB_API_ADDRESS: "192.168.99.100:8000" | ||
CRAWLAB_SERVER_MASTER: "Y" | ||
CRAWLAB_MONGO_HOST: "192.168.99.1" | ||
CRAWLAB_REDIS_ADDRESS: "192.168.99.1" | ||
CRAWLAB_LOG_PATH: "/var/logs/crawlab" | ||
ports: | ||
- "8080:8080" # frontend | ||
- "8000:8000" # backend | ||
volumes: | ||
- "/Users/yeqing/projects/artipub/spiders:/app/spiders" | ||
MONGO_HOST: "mongo" | ||
ports: | ||
- "8000:8000" # frontend | ||
- "3000:3000" # backend | ||
depends_on: | ||
- mongo | ||
mongo: | ||
image: mongo:latest | ||
restart: always | ||
ports: | ||
- "27017:27017" |
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,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
# replace original url to new one | ||
if [ "${ARTIPUB_API_ADDRESS}" = "" ]; | ||
then | ||
: | ||
else | ||
jspath=`ls /frontend/umi.*.js` | ||
sed -i "s?localhost:3000?${ARTIPUB_API_ADDRESS}?g" ${jspath} | ||
fi | ||
|
||
# start frontend | ||
nginx -s stop | true | ||
nginx | ||
|
||
# start backend | ||
npm run start:backend |
Oops, something went wrong.