mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
ci: updated dockerfile
This commit is contained in:
25
Dockerfile
25
Dockerfile
@@ -6,30 +6,19 @@ FROM crawlabteam/crawlab-frontend:${CRAWLAB_TAG} AS frontend-build
|
||||
|
||||
FROM crawlabteam/crawlab-base:${CRAWLAB_TAG}
|
||||
|
||||
# copy backend files
|
||||
RUN mkdir -p /opt/bin
|
||||
COPY --from=backend-build /go/bin/crawlab /opt/bin
|
||||
RUN cp /opt/bin/crawlab /usr/local/bin/crawlab-server
|
||||
|
||||
# copy backend config files
|
||||
COPY ./backend/conf /app/backend/conf
|
||||
|
||||
# copy frontend files
|
||||
# Copy files
|
||||
COPY --from=backend-build /go/bin/crawlab /usr/local/bin/crawlab-server
|
||||
COPY --from=frontend-build /app/dist /app/dist
|
||||
|
||||
# copy nginx config files
|
||||
COPY ./backend/conf /app/backend/conf
|
||||
COPY ./docker/nginx/crawlab.conf /etc/nginx/conf.d
|
||||
COPY ./docker/bin/docker-init.sh /app/bin/docker-init.sh
|
||||
|
||||
# copy docker bin files
|
||||
RUN mkdir -p /app/bin
|
||||
COPY ./docker/bin/* /app/bin
|
||||
|
||||
# start backend
|
||||
# Start backend
|
||||
CMD ["/bin/bash", "/app/bin/docker-init.sh"]
|
||||
|
||||
# frontend port
|
||||
# Frontend port
|
||||
EXPOSE 8080
|
||||
|
||||
# healthcheck for backend
|
||||
# Healthcheck for backend
|
||||
HEALTHCHECK --interval=1m --timeout=3s \
|
||||
CMD curl -f http://localhost:8000/health || exit 1
|
||||
@@ -1,6 +1,12 @@
|
||||
#!/bin/bash
|
||||
|
||||
# replace default api path to new one
|
||||
python /app/bin/update_docker_js_api_address.py
|
||||
if [ "${CRAWLAB_MASTER_NODE}" == "Y" ]; then
|
||||
# Replace default api path to new one
|
||||
python /app/bin/update_docker_js_api_address.py
|
||||
|
||||
# Start nginx
|
||||
service nginx start
|
||||
fi
|
||||
|
||||
# Start backend
|
||||
crawlab-server server
|
||||
|
||||
Binary file not shown.
@@ -10,12 +10,7 @@ services:
|
||||
- "8080:8080"
|
||||
depends_on:
|
||||
- mongo
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
|
||||
|
||||
worker:
|
||||
image: ghcr.io/crawlab-team/crawlab:${CRAWLAB_TAG:-develop}
|
||||
container_name: crawlab_ghcr_worker
|
||||
@@ -24,11 +19,6 @@ services:
|
||||
CRAWLAB_MASTER_HOST: "master"
|
||||
depends_on:
|
||||
- master
|
||||
healthcheck:
|
||||
test: ["CMD", "curl", "-f", "http://localhost:8000/health"]
|
||||
interval: 30s
|
||||
timeout: 10s
|
||||
retries: 5
|
||||
|
||||
|
||||
mongo:
|
||||
image: mongo:5
|
||||
|
||||
Reference in New Issue
Block a user