-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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 #169 from crawlab-team/develop
Develop
- Loading branch information
Showing
2 changed files
with
24 additions
and
4 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
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,20 +1,27 @@ | ||
FROM node:8.16.0 AS frontend-build | ||
|
||
ADD ./frontend /app | ||
WORKDIR /app | ||
|
||
# install frontend | ||
RUN npm install -g yarn && yarn install --registry=https://registry.npm.taobao.org | ||
|
||
RUN npm run build:prod | ||
|
||
FROM alpine:latest | ||
|
||
# 安装nginx | ||
RUN mkdir /run/nginx && apk add nginx | ||
|
||
# 拷贝编译文件 | ||
COPY dist /app/dist | ||
COPY --from=frontend-build /app/dist /app/dist | ||
|
||
# 拷贝nginx代理文件 | ||
COPY crawlab.conf /etc/nginx/conf.d | ||
|
||
# 拷贝执行脚本 | ||
COPY docker_init.sh /app/docker_init.sh | ||
|
||
# 定义后端API脚本 | ||
ENV CRAWLAB_API_ADDRESS http://localhost:8000 | ||
|
||
EXPOSE 8080 | ||
|
||
CMD ["/bin/sh", "/app/docker_init.sh"] |