fix: isolate prod deploy from dev env port conflict
The production deploy failed because port 3000 was already bound by the dev frontend container (bilhej-frontend). The prod frontend doesn't need a host port at all — nginx talks to it via the external 'web' network. Changes: - Remove host port binding (3000:80) from prod frontend - Remove unused 'certs' volume from prod compose - Use --project-name bilhej-prod in deploy workflow to isolate prod containers/networks from dev and e2e environments - Add 'docker compose down' before 'up' for clean deploys - Update health check network names to bilhej-prod_default
This commit is contained in:
parent
d078b9e125
commit
dfcc8e37c6
2 changed files with 5 additions and 9 deletions
|
|
@ -42,7 +42,8 @@ jobs:
|
|||
|
||||
- name: Build and start production stack
|
||||
run: |
|
||||
docker compose -f docker-compose.prod.yml up --build -d
|
||||
docker compose -p bilhej-prod -f docker-compose.prod.yml down
|
||||
docker compose -p bilhej-prod -f docker-compose.prod.yml up --build -d
|
||||
|
||||
- name: Wait for services
|
||||
run: sleep 20
|
||||
|
|
@ -50,7 +51,7 @@ jobs:
|
|||
- name: Health check — backend API
|
||||
run: |
|
||||
for i in 1 2 3 4 5; do
|
||||
if docker run --rm --network bilhej_default curlimages/curl:8.5.0 \
|
||||
if docker run --rm --network bilhej-prod_default curlimages/curl:8.5.0 \
|
||||
-sf http://bilhej-backend-prod:8080/api/vehicles/ZZZ999; then
|
||||
echo "Backend is healthy"
|
||||
exit 0
|
||||
|
|
@ -64,7 +65,7 @@ jobs:
|
|||
- name: Health check — frontend
|
||||
run: |
|
||||
for i in 1 2 3 4 5; do
|
||||
if docker run --rm --network bilhej_default curlimages/curl:8.5.0 \
|
||||
if docker run --rm --network bilhej-prod_default curlimages/curl:8.5.0 \
|
||||
-sf http://bilhej-frontend-prod/ | grep -qi "bilhej\|Bilhej\|BilHej"; then
|
||||
echo "Frontend is serving"
|
||||
exit 0
|
||||
|
|
@ -82,7 +83,7 @@ jobs:
|
|||
echo " Deployed ${{ github.event.inputs.version }} to production"
|
||||
echo "═══════════════════════════════════════════════════"
|
||||
echo ""
|
||||
docker compose -f docker-compose.prod.yml ps
|
||||
docker compose -p bilhej-prod -f docker-compose.prod.yml ps
|
||||
echo ""
|
||||
echo "Containers running. Update nginx config on srvr.nu"
|
||||
echo "to point bilhej.se to the frontend container."
|
||||
|
|
|
|||
|
|
@ -39,12 +39,8 @@ services:
|
|||
dockerfile: docker/frontend.prod.Dockerfile
|
||||
context: .
|
||||
container_name: bilhej-frontend-prod
|
||||
ports:
|
||||
- "3000:80"
|
||||
depends_on:
|
||||
- backend
|
||||
volumes:
|
||||
- certs:/etc/nginx/certs
|
||||
networks:
|
||||
- default
|
||||
- web
|
||||
|
|
@ -52,7 +48,6 @@ services:
|
|||
|
||||
volumes:
|
||||
pgdata-prod:
|
||||
certs:
|
||||
|
||||
networks:
|
||||
web:
|
||||
|
|
|
|||
Loading…
Reference in a new issue