Skip to content

Commit ad031e0

Browse files
committed
updated Dockerfile
1 parent a98e2a7 commit ad031e0

File tree

5 files changed

+18
-32
lines changed

5 files changed

+18
-32
lines changed

.github/workflows/docker-crawlab.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
cd $IMAGE_PATH_CRAWLAB_BACKEND
8888
docker build . --file Dockerfile --tag image
8989
- name: Log into registry
90-
run: echo ${{ secrets.DOCKER_PASSWORD}} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
90+
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
9191
- name: Push image
9292
run: |
9393
IMAGE_VERSION=${{needs.setup.outputs.version}}
@@ -109,7 +109,7 @@ jobs:
109109
cd $IMAGE_PATH_CRAWLAB_FRONTEND
110110
docker build . --file Dockerfile --tag image
111111
- name: Log into registry
112-
run: echo ${{ secrets.DOCKER_PASSWORD}} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
112+
run: echo ${{ secrets.DOCKER_PASSWORD }} | docker login -u ${{ secrets.DOCKER_USERNAME }} --password-stdin
113113
- name: Push image
114114
run: |
115115
IMAGE_VERSION=${{needs.setup.outputs.version}}

Dockerfile

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ FROM crawlabteam/crawlab-backend:latest AS backend-build
22

33
FROM crawlabteam/crawlab-frontend:latest AS frontend-build
44

5+
FROM crawlabteam/crawlab-public-plugins:latest AS public-plugins-build
6+
57
# images
68
FROM crawlabteam/crawlab-base:latest
79

@@ -18,11 +20,11 @@ RUN cp /opt/bin/crawlab /usr/local/bin/crawlab-server
1820
# copy frontend files
1921
COPY --from=frontend-build /app/dist /app/dist
2022

23+
# copy public-plugins files
24+
COPY --from=public-plugins-build /app/plugins /app/plugins
25+
2126
# copy nginx config files
2227
COPY ./nginx/crawlab.conf /etc/nginx/conf.d
2328

24-
# install plugins
25-
RUN /bin/bash /app/bin/docker-install-plugins.sh
26-
2729
# start backend
2830
CMD ["/bin/bash", "/app/bin/docker-init.sh"]

backend/Dockerfile

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.16
1+
FROM golang:1.16 AS build
22

33
WORKDIR /go/src/app
44
COPY . .
@@ -9,3 +9,7 @@ ENV GO111MODULE on
99
RUN go mod tidy \
1010
&& go install -v ./...
1111

12+
FROM alpine:3.14
13+
14+
# copy files
15+
COPY --from=backend-build /go/bin/crawlab /go/bin/crawlab

bin/docker-install-plugins.sh

Lines changed: 0 additions & 25 deletions
This file was deleted.

frontend/Dockerfile

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,13 @@
1-
FROM node:12
1+
FROM node:12 AS build
22

33
ADD . /app
44
WORKDIR /app
55
RUN rm /app/.npmrc
66

77
# install frontend
88
RUN yarn install && yarn run build:docker
9+
10+
FROM alpine:3.14
11+
12+
# copy files
13+
COPY --from=build /app/dist /app/dist

0 commit comments

Comments
 (0)