Skip to content

Commit

Permalink
Update ci.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
CYHFREDA authored Oct 15, 2024
1 parent c8a5ba7 commit b2038bd
Showing 1 changed file with 11 additions and 32 deletions.
43 changes: 11 additions & 32 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,38 +35,20 @@ jobs:

test:
runs-on: ubuntu-latest
needs: build # 這一行確保測試在 build 完成後執行
needs: build # 確保在 build 完成後執行
services:
backend:
build: ./backend
ports:
- 5001:5001
env:
MONGO_URI: mongodb://root:1qaz2wsx@mongo:27017/clockdb?authSource=admin
ALLOWED_ORIGINS: http://nginx
volumes:
- /etc/localtime:/etc/localtime:ro

control-backend:
build: ./control-backend
mongo:
image: mongo:latest
ports:
- 5002:5002
- 27017:27017
env:
MONGO_URI: mongodb://root:1qaz2wsx@mongo:27017/clockdb?authSource=admin
ALLOWED_ORIGINS: http://nginx

nginx:
image: nginx:latest
ports:
- 80:80
volumes:
- ./nginx:/etc/nginx
- ./frontend:/usr/share/nginx/html
- ./nginx/log:/var/log/nginx
- /etc/localtime:/etc/localtime:ro
depends_on:
- backend
- control-backend
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: 1qaz2wsx
options: >-
--health-cmd="mongo --eval 'db.adminCommand(\"ping\")'"
--health-interval=10s
--health-timeout=5s
--health-retries=5
steps:
- name: Checkout code
Expand All @@ -85,6 +67,3 @@ jobs:
- name: Stop and remove containers
run: docker-compose down

volumes:
mongodb_data:

0 comments on commit b2038bd

Please sign in to comment.