This commit is contained in:
parent
12a6336b58
commit
2d8ea729de
@ -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,14 +79,15 @@ jobs:
|
|||||||
ports:
|
ports:
|
||||||
- "5173:80"
|
- "5173:80"
|
||||||
depends_on:
|
depends_on:
|
||||||
- backend
|
backend:
|
||||||
|
condition: service_healthy
|
||||||
networks:
|
networks:
|
||||||
- chat-network
|
- chat-network
|
||||||
|
|
||||||
networks:
|
networks:
|
||||||
chat-network:
|
chat-network:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
EOL
|
EOL
|
||||||
|
|
||||||
- name: Deploy with SSH
|
- name: Deploy with SSH
|
||||||
uses: appleboy/ssh-action@master
|
uses: appleboy/ssh-action@master
|
||||||
@ -112,6 +123,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
|
||||||
|
|||||||
@ -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"]
|
|
||||||
Loading…
x
Reference in New Issue
Block a user