feat: changed Dockerfile, docker-compose.yml
This commit is contained in:
parent
9a05cbd665
commit
8a1bec59ff
1 changed files with 10 additions and 10 deletions
20
.github/workflows/deploy.yml
vendored
20
.github/workflows/deploy.yml
vendored
|
@ -25,22 +25,22 @@ jobs:
|
|||
with:
|
||||
ssh-private-key: ${{ secrets.SSH_KEY }}
|
||||
|
||||
- name: Copy files to server
|
||||
- name: Copy Docker files to server
|
||||
run: |
|
||||
scp -o StrictHostKeyChecking=no docker-compose.yml Dockerfile ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/${{ secrets.SSH_USER }}/munera/
|
||||
scp -o StrictHostKeyChecking=no target/munera-1.0-SNAPSHOT.jar ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/${{ secrets.SSH_USER }}/munera/
|
||||
scp -o StrictHostKeyChecking=no docker-compose.yml Dockerfile ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/home/effe/munera/
|
||||
|
||||
- name: Deploy using Docker Compose
|
||||
- name: Deploy Docker containers
|
||||
run: |
|
||||
ssh -o StrictHostKeyChecking=no ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} << 'EOF'
|
||||
cd /home/${{ secrets.SSH_USER }}/munera
|
||||
|
||||
# Stop and remove only the specific application container
|
||||
docker stop vaadin-app || true
|
||||
docker rm vaadin-app || true
|
||||
cd /home/effe/munera
|
||||
|
||||
# Build and start the containers (including the database container)
|
||||
# Stop and remove existing containers for vaadin-app only
|
||||
docker-compose stop vaadin-app || true
|
||||
docker-compose rm -f vaadin-app || true
|
||||
|
||||
# Rebuild and restart containers using docker-compose
|
||||
docker-compose up -d --build
|
||||
|
||||
EOF
|
||||
env:
|
||||
DB_ADDRESS: ${{ secrets.DB_ADDRESS }}
|
||||
|
|
Loading…
Reference in a new issue