file_system/.gitlab-ci.yml
root f894bc212e Revert to using private registry for all images
- Changed .gitlab-ci.yml back to use 192.168.1.154:31010/alpine:latest and docker/compose:latest
- Updated Dockerfile to use private registry alpine image
- Fixed Docker installation order in CI/CD
- All images now consistently use private registry

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-19 09:45:01 +08:00

38 lines
947 B
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

stages:
- build
- deploy
variables:
DOCKER_IMAGE_NAME: file-system-server
DOCKER_TAG: latest
CI_REGISTRY: "192.168.1.154:31010"
CI_REGISTRY_USER: "docker"
CI_REGISTRY_PASSWORD: "dockerxn001624."
# 构建镜像
build_image:
stage: build
image: 192.168.1.154:31010/alpine:latest
script:
- apk add --no-cache docker-cli
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
- docker build -t $DOCKER_IMAGE_NAME:$DOCKER_TAG .
only:
- main
# 部署服务
deploy_service:
stage: deploy
image: 192.168.1.154:31010/docker/compose:latest
script:
# 停止旧容器(如果存在)
- docker-compose down --remove-orphans || true
# 重新构建并启动服务
- docker-compose up -d --build
# 清理未使用的镜像
- docker image prune -f
tags:
- shell # 假设您的 GitLab Runner 是 Shell Executor可以直接操作宿主机 Docker
only:
- main