mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
updated Dockerfile
This commit is contained in:
@@ -2,6 +2,8 @@ FROM crawlabteam/crawlab-backend:latest AS backend-build
|
||||
|
||||
FROM crawlabteam/crawlab-frontend:latest AS frontend-build
|
||||
|
||||
FROM crawlabteam/crawlab-public-plugins:latest AS public-plugins-build
|
||||
|
||||
# images
|
||||
FROM crawlabteam/crawlab-base:latest
|
||||
|
||||
@@ -18,11 +20,11 @@ RUN cp /opt/bin/crawlab /usr/local/bin/crawlab-server
|
||||
# copy frontend files
|
||||
COPY --from=frontend-build /app/dist /app/dist
|
||||
|
||||
# copy public-plugins files
|
||||
COPY --from=public-plugins-build /app/plugins /app/plugins
|
||||
|
||||
# copy nginx config files
|
||||
COPY ./nginx/crawlab.conf /etc/nginx/conf.d
|
||||
|
||||
# install plugins
|
||||
RUN /bin/bash /app/bin/docker-install-plugins.sh
|
||||
|
||||
# start backend
|
||||
CMD ["/bin/bash", "/app/bin/docker-init.sh"]
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM golang:1.16
|
||||
FROM golang:1.16 AS build
|
||||
|
||||
WORKDIR /go/src/app
|
||||
COPY . .
|
||||
@@ -9,3 +9,7 @@ ENV GO111MODULE on
|
||||
RUN go mod tidy \
|
||||
&& go install -v ./...
|
||||
|
||||
FROM alpine:3.14
|
||||
|
||||
# copy files
|
||||
COPY --from=backend-build /go/bin/crawlab /go/bin/crawlab
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
function install_plugin() {
|
||||
# plugins executables directory
|
||||
local bin_path="/app/plugins/bin"
|
||||
if [ -d $bin_path ]; then
|
||||
:
|
||||
else
|
||||
mkdir -p "$bin_path"
|
||||
fi
|
||||
|
||||
# plugin name
|
||||
local name=$1
|
||||
local url="https://github.com/crawlab-team/${name}"
|
||||
local repo_path=""/app/plugins/${name}
|
||||
git clone "$url" "$repo_path"
|
||||
cd "$repo_path" && go build -o "${bin_path}/${name}"
|
||||
chmod +x "${bin_path}/${name}"
|
||||
}
|
||||
|
||||
plugin_names="plugin-dependency plugin-notification plugin-spider-assistant"
|
||||
|
||||
for name in $plugin_names; do
|
||||
install_plugin "$name"
|
||||
done
|
||||
@@ -1,4 +1,4 @@
|
||||
FROM node:12
|
||||
FROM node:12 AS build
|
||||
|
||||
ADD . /app
|
||||
WORKDIR /app
|
||||
@@ -6,3 +6,8 @@ RUN rm /app/.npmrc
|
||||
|
||||
# install frontend
|
||||
RUN yarn install && yarn run build:docker
|
||||
|
||||
FROM alpine:3.14
|
||||
|
||||
# copy files
|
||||
COPY --from=build /app/dist /app/dist
|
||||
|
||||
Reference in New Issue
Block a user