From 60c5615bd3d0f91ba2c1643b5a6d583dee2bfd39 Mon Sep 17 00:00:00 2001 From: Benjamin Bolte Date: Mon, 20 May 2024 15:00:28 -0700 Subject: [PATCH] docker build and run commands --- docker/build.sh | 25 +++++++++++++++++++++++++ docker/run.sh | 8 ++++++++ 2 files changed, 33 insertions(+) create mode 100755 docker/build.sh create mode 100755 docker/run.sh diff --git a/docker/build.sh b/docker/build.sh new file mode 100755 index 00000000..0d912026 --- /dev/null +++ b/docker/build.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# Builds the Docker image. +# Usage: +# ./docker/build.sh + +set -e + +# Checks that the home directory is the root of the project. +if [[ ! -f "store/requirements.txt" ]]; then + echo "Error: Please run this script from the root of the project." + exit 1 +fi + +# Builds the API Docker image. +docker build -t kscale-store -f docker/Dockerfile . + +# Log in to ECR. +# aws ecr get-login-password | docker login --username AWS --password-stdin ${WIKIBOT_ECR_URI} + +# Pushes the Docker image to ECR. +# docker tag kscale-store:latest ${WIKIBOT_ECR_URI}:latest +# docker push ${WIKIBOT_ECR_URI}:latest + +# Runs the Docker image locally. +# docker run kscale-store:latest diff --git a/docker/run.sh b/docker/run.sh new file mode 100755 index 00000000..50b7f124 --- /dev/null +++ b/docker/run.sh @@ -0,0 +1,8 @@ +#!/bin/bash +# Runs the Docker image. +# Usage: +# ./docker/run.sh + +# Exposes port 80 on the container to port 8080 on the host. +# Visible at http://localhost:8080 +docker run -p 8080:80 kscale-store:latest