This commit is contained in:
parent
12a6336b58
commit
2d8ea729de
@ -58,10 +58,20 @@ jobs:
|
||||
backend:
|
||||
image: harbor.galpodlipnik.com/chat-app/backend:latest
|
||||
restart: always
|
||||
env_file:
|
||||
- ./.env
|
||||
# Instead of env_file, define the environment variables directly
|
||||
environment:
|
||||
- NODE_ENV=production
|
||||
- PORT=3000
|
||||
- CORS_ORIGIN=http://localhost:5173
|
||||
- DATABASE_URL=${DATABASE_URL}
|
||||
- JWT_SECRET=${JWT_SECRET}
|
||||
networks:
|
||||
- chat-network
|
||||
healthcheck:
|
||||
test: ["CMD", "wget", "-qO-", "http://localhost:3000/health"]
|
||||
interval: 10s
|
||||
timeout: 5s
|
||||
retries: 5
|
||||
|
||||
frontend:
|
||||
image: harbor.galpodlipnik.com/chat-app/frontend:latest
|
||||
@ -69,7 +79,8 @@ jobs:
|
||||
ports:
|
||||
- "5173:80"
|
||||
depends_on:
|
||||
- backend
|
||||
backend:
|
||||
condition: service_healthy
|
||||
networks:
|
||||
- chat-network
|
||||
|
||||
@ -113,6 +124,10 @@ jobs:
|
||||
# Login to Harbor registry
|
||||
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
|
||||
docker compose pull
|
||||
docker compose down
|
||||
|
||||
@ -10,5 +10,4 @@ COPY . .
|
||||
RUN npm run db:generate
|
||||
RUN npm run build
|
||||
|
||||
EXPOSE 3000
|
||||
CMD ["npm", "start"]
|
||||
CMD ["node", "dist/index.js"]
|
||||
Loading…
x
Reference in New Issue
Block a user