Skip to content

Commit

Permalink
Add a docker build file with no secrets for github actions
Browse files Browse the repository at this point in the history
Signed-off-by: ZhuoweiWen <[email protected]>
  • Loading branch information
ZhuoweiWen committed Jul 21, 2024
1 parent e1734b6 commit 89a5a12
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 3 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/docker_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ jobs:
- name: Login to GitHub Docker Registry
run: echo "${{secrets.DOCKER_LOGIN_TOKEN}}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin

- name: Build Docker images using docker-compose.yml
run: docker-compose -f docker-compose.yml build
- name: Build Docker images using docker-compose.build.yml
run: docker-compose -f docker-compose.build.yml build

- name: Push Docker images to registry
run: |
docker push ghcr.io/spin-vt/worker:latest
docker push ghcr.io/spin-vt/backend:latest
docker push ghcr.io/spin-vt/frontend:latest
docker push ghcr.io/spin-vt/my-nginx:latest
46 changes: 46 additions & 0 deletions docker-compose.build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
services:
work:
image: ghcr.io/spin-vt/backend
build:
context: ./back-end
dockerfile: Dockerfile.worker
command: celery -A controllers.celery_controller.celery_config.celery worker --loglevel=DEBUG
volumes:
- ./back-end:/app
depends_on:
- redis

backend:
image: ghcr.io/spin-vt/worker
build:
context: ./back-end
dockerfile: Dockerfile.backend
command: gunicorn routes:app -b 0.0.0.0:8000 -w 4 --log-level debug --reload
volumes:
- ./back-end:/app
depends_on:
- db
- redis
expose:
- 8000

frontend:
image: ghcr.io/spin-vt/frontend
build: ./front-end
volumes:
- ./front-end:/app
depends_on:
- backend
expose:
- 3000

nginx:
image: ghcr.io/spin-vt/my-nginx
build:
context: ./
dockerfile: Dockerfile.nginx
container_name: nginx-proxy
depends_on:
- backend
- frontend

2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ services:
image: nginx:latest
container_name: nginx-proxy
ports:
- "80:80"
- "${NGINX_HTTP_PORT}:${NGINX_HTTP_PORT}"
volumes:
- ./nginx.conf.local:/etc/nginx/conf.d/default.conf
depends_on:
Expand Down

0 comments on commit 89a5a12

Please sign in to comment.