From 9e3de6eeaf1987273cefd7364b47948393389839 Mon Sep 17 00:00:00 2001 From: Johann Frei Date: Wed, 14 Apr 2021 20:09:53 +0200 Subject: [PATCH] Move commands to other script --- offline_deployment/offline_01_2-extract_Docker_images.sh | 7 +++++++ offline_deployment/offline_02_2-import_Docker_images.sh | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/offline_deployment/offline_01_2-extract_Docker_images.sh b/offline_deployment/offline_01_2-extract_Docker_images.sh index 955d60a0..2b41725c 100755 --- a/offline_deployment/offline_01_2-extract_Docker_images.sh +++ b/offline_deployment/offline_01_2-extract_Docker_images.sh @@ -11,6 +11,13 @@ sed -i 's|version: "3.7"|version: "3.3"|g' ../docker-compose.prod.yml sed -i 's^dockerfile: app/Dockerfile.prod^dockerfile: app/Dockerfile.prod\n image: doccano-app: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\ +RUN apk add -U --no-cache py3-requests \\\ + \&\& mkdir -p /app/dist/static/offline \&\& python3 /patch.py /app/dist /app/dist/static/offline /offline\ +\ +FROM nginx|' ../nginx/Dockerfile + docker-compose -f ../docker-compose.prod.yml pull docker-compose -f ../docker-compose.prod.yml build diff --git a/offline_deployment/offline_02_2-import_Docker_images.sh b/offline_deployment/offline_02_2-import_Docker_images.sh index b7b4f7a2..58c0fb9c 100755 --- a/offline_deployment/offline_02_2-import_Docker_images.sh +++ b/offline_deployment/offline_02_2-import_Docker_images.sh @@ -8,13 +8,6 @@ unset DIR sed -i 's^dockerfile: app/Dockerfile.prod^dockerfile: app/Dockerfile.prod\n image: doccano-app: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\ -RUN apk add -U --no-cache py3-requests \\\ - \&\& mkdir -p /app/dist/static/offline \&\& python3 /patch.py /app/dist /app/dist/static/offline /offline\ -\ -FROM nginx|' ../nginx/Dockerfile - # Load docker images docker image load -i doccano-app.tar docker image load -i doccano-nginx.tar