Browse Source

Patch compose file only once

pull/1322/head
Johann Frei 3 years ago
parent
commit
784cea583c
2 changed files with 5 additions and 4 deletions
  1. 2
      offline_deployment/offline_01_2-patch_and_extract_Docker_images.sh
  2. 7
      offline_deployment/offline_02_2-import_Docker_images.sh

2
offline_deployment/offline_01_2-patch_and_extract_Docker_images.sh

@ -9,7 +9,7 @@ echo "Patching docker-compose to match Ubuntu 18.04 compose package"
sed -i 's|version: "3.7"|version: "3.3"|g' ../docker-compose.prod.yml
sed -i 's^dockerfile: backend/Dockerfile.prod^dockerfile: backend/Dockerfile.prod\n image: doccano-backend:custom^g' ../docker-compose.prod.yml
sed -i 's^dockerfile: nginx/Dockerfile^dockerfile: nginx/Dockerfile\n image: doccano-nginx:custom^g' ../docker-compose.prod.yml
sed -i 's^dockerfile: nginx/Dockerfile^dockerfile: nginx/Dockerfile\n image: doccano-nginx:custom^g' ../docker-compose.prod.yml
# Modify Dockerfile for nginx to add python3 and offline patch
sed -i 's|FROM nginx|COPY offline_deployment/offline_patcher.py /patch.py\

7
offline_deployment/offline_02_2-import_Docker_images.sh

@ -4,9 +4,10 @@ DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
cd $DIR
unset DIR
# Set image tag in Compose to avoid image build
sed -i 's^dockerfile: backend/Dockerfile.prod^dockerfile: backend/Dockerfile.prod\n image: doccano-backend:custom^g' ../docker-compose.prod.yml
sed -i 's^dockerfile: nginx/Dockerfile^dockerfile: nginx/Dockerfile\n image: doccano-nginx:custom^g' ../docker-compose.prod.yml
# Info: Docker image name is already set in previous scripts
## Set image tag in Compose to avoid image build
#sed -i 's^dockerfile: backend/Dockerfile.prod^dockerfile: backend/Dockerfile.prod\n image: doccano-backend:custom^g' ../docker-compose.prod.yml
#sed -i 's^dockerfile: nginx/Dockerfile^dockerfile: nginx/Dockerfile\n image: doccano-nginx:custom^g' ../docker-compose.prod.yml
# Load docker images
docker image load -i doccano-backend.tar

Loading…
Cancel
Save