cicd 10
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 1m32s

This commit is contained in:
Gal Podlipnik 2025-06-12 16:51:43 +02:00
parent 12a6336b58
commit 2d8ea729de
2 changed files with 20 additions and 6 deletions

View File

@ -58,10 +58,20 @@ jobs:
backend: backend:
image: harbor.galpodlipnik.com/chat-app/backend:latest image: harbor.galpodlipnik.com/chat-app/backend:latest
restart: always restart: always
env_file: # Instead of env_file, define the environment variables directly
- ./.env environment:
- NODE_ENV=production
- PORT=3000
- CORS_ORIGIN=http://localhost:5173
- DATABASE_URL=${DATABASE_URL}
- JWT_SECRET=${JWT_SECRET}
networks: networks:
- chat-network - chat-network
healthcheck:
test: ["CMD", "wget", "-qO-", "http://localhost:3000/health"]
interval: 10s
timeout: 5s
retries: 5
frontend: frontend:
image: harbor.galpodlipnik.com/chat-app/frontend:latest image: harbor.galpodlipnik.com/chat-app/frontend:latest
@ -69,7 +79,8 @@ jobs:
ports: ports:
- "5173:80" - "5173:80"
depends_on: depends_on:
- backend backend:
condition: service_healthy
networks: networks:
- chat-network - chat-network
@ -113,6 +124,10 @@ jobs:
# Login to Harbor registry # Login to Harbor registry
echo "${{ secrets.HARBOR_PASSWORD }}" | docker login harbor.galpodlipnik.com -u "${{ secrets.HARBOR_USERNAME }}" --password-stdin echo "${{ secrets.HARBOR_PASSWORD }}" | docker login harbor.galpodlipnik.com -u "${{ secrets.HARBOR_USERNAME }}" --password-stdin
export DATABASE_URL=${{ secrets.DATABASE_URL }}
export JWT_SECRET=${{ secrets.JWT_SECRET }}
docker-compose up -d
# Pull latest images and deploy # Pull latest images and deploy
docker compose pull docker compose pull
docker compose down docker compose down

View File

@ -10,5 +10,4 @@ COPY . .
RUN npm run db:generate RUN npm run db:generate
RUN npm run build RUN npm run build
EXPOSE 3000 CMD ["node", "dist/index.js"]
CMD ["npm", "start"]