chore(infra): mount dist volume directly to frontend container to allow instantaneous updates without cached images
This commit is contained in:
@@ -40,6 +40,11 @@ npm install
|
||||
npm run build
|
||||
|
||||
# 4. Sincronizar arquivos com a VPS 1 (Produção) via Rsync VPN
|
||||
log "🚚 Sincronizando arquivos de infraestrutura (Compose e Nginx) com a VPS 1..."
|
||||
rsync -avz /home/deploy/stack/subdominio.clube67.com/docker-compose.yml deploy@10.99.0.1:/home/deploy/stack/subdominio.clube67.com/
|
||||
rsync -avz /home/deploy/stack/subdominio.clube67.com/frontend/nginx.conf deploy@10.99.0.1:/home/deploy/stack/subdominio.clube67.com/frontend/nginx.conf
|
||||
rsync -avz --delete /home/deploy/stack/subdominio.clube67.com/nginx/ deploy@10.99.0.1:/home/deploy/stack/subdominio.clube67.com/nginx/
|
||||
|
||||
log "🚚 Despachando Backend para a VPS 1 (Produção)..."
|
||||
rsync -avz --delete \
|
||||
--exclude 'node_modules/.cache' \
|
||||
@@ -53,7 +58,7 @@ rsync -avz --delete \
|
||||
|
||||
# 5. Reiniciar os serviços de produção na VPS 1
|
||||
log "🔄 Reiniciando containers na VPS 1..."
|
||||
ssh -o BatchMode=yes deploy@10.99.0.1 "cd /home/deploy/stack/subdominio.clube67.com && DOCKER_HOST=unix:///run/user/1000/docker.sock docker compose up -d"
|
||||
ssh -o BatchMode=yes deploy@10.99.0.1 "cd /home/deploy/stack/subdominio.clube67.com && DOCKER_HOST=unix:///run/user/1000/docker.sock docker compose up -d --remove-orphans"
|
||||
|
||||
# 6. Salvar incremento de versão no Git
|
||||
log "💾 Comitando o incremento de versão de volta para o repositório central..."
|
||||
|
||||
+4
-2
@@ -1,9 +1,11 @@
|
||||
services:
|
||||
frontend:
|
||||
build:
|
||||
context: ./frontend
|
||||
image: nginx:alpine
|
||||
container_name: subdominio-frontend
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./frontend/dist:/usr/share/nginx/html:ro
|
||||
- ./frontend/nginx.conf:/etc/nginx/conf.d/default.conf:ro
|
||||
networks:
|
||||
- subdominio-net
|
||||
|
||||
|
||||
Reference in New Issue
Block a user