-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdev
executable file
·28 lines (22 loc) · 1003 Bytes
/
dev
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/bash
echo "Building and running the Docker container. Recall: Use up.sh for building for production-use."
# Load variables from .env file
export $(grep -v '^#' .env | xargs)
# Print the secret key (for verification)
echo "dev.sh printing: DJANGO_SECRET_KEY:" $DJANGO_SECRET_KEY
# Stop and remove any currently running container with the procureinsight image
container_id=$(docker ps -q --filter "ancestor=procureguru:latest")
if [ -n "$container_id" ]; then
echo "Stopping and removing the currently running container with image 'procureguru:latest' (ID: $container_id)..."
docker stop $container_id
docker rm $container_id
else
echo "No running container with image 'procureguru:latest' found."
fi
docker build -t procureguru .
docker run -p 8080:8080 \
-e DJANGO_SECRET_KEY=$DJANGO_SECRET_KEY \
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
-e AWS_STORAGE_BUCKET_NAME=$AWS_STORAGE_BUCKET_NAME \
procureguru